|
1 | 1 | /* |
2 | 2 | * Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. |
3 | | - * |
| 3 | + * |
4 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | | - * copy of this software and associated documentation files (the "Software"), |
6 | | - * to deal in the Software without restriction, including without limitation |
7 | | - * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
8 | | - * and/or sell copies of the Software, and to permit persons to whom the |
| 5 | + * copy of this software and associated documentation files (the "Software"), |
| 6 | + * to deal in the Software without restriction, including without limitation |
| 7 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | + * and/or sell copies of the Software, and to permit persons to whom the |
9 | 9 | * Software is furnished to do so, subject to the following conditions: |
10 | | - * |
| 10 | + * |
11 | 11 | * The above copyright notice and this permission notice shall be included in |
12 | 12 | * all copies or substantial portions of the Software. |
13 | | - * |
| 13 | + * |
14 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
15 | | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
16 | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
17 | | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
18 | | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
19 | | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 17 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 19 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | 20 | * DEALINGS IN THE SOFTWARE. |
21 | | - * |
| 21 | + * |
22 | 22 | */ |
23 | 23 | /*global module, require*/ |
24 | 24 |
|
25 | 25 | module.exports = function (grunt) { |
26 | 26 | "use strict"; |
27 | 27 |
|
28 | 28 | var common = require("./lib/common")(grunt); |
29 | | - |
30 | | - // task: update-sprint-number |
| 29 | + |
| 30 | + // task: update-release-number |
31 | 31 | // Updates the version property in package.json |
32 | | - grunt.registerTask('update-sprint-number', function () { |
| 32 | + grunt.registerTask('update-release-number', function () { |
33 | 33 | var path = "package.json", |
34 | 34 | packageJSON = grunt.file.readJSON(path), |
35 | | - sprint = grunt.option("sprint") || 0, |
| 35 | + release = grunt.option("release") || 0, |
36 | 36 | versionNumberRegexp = /([0-9]+\.)([0-9]+)([\.\-a-zA-Z0-9]*)?/; |
37 | 37 |
|
38 | | - if (!sprint) { |
39 | | - grunt.fail.fatal("Please specify a sprint. e.g. grunt update-sprint-number --sprint=21"); |
| 38 | + if (!release) { |
| 39 | + grunt.fail.fatal("Please specify a release. e.g. grunt update-release-number --release=40"); |
40 | 40 | } |
41 | | - |
42 | | - packageJSON.version = packageJSON.version.replace(versionNumberRegexp, "$1" + sprint + "$3"); |
43 | | - packageJSON.apiVersion = packageJSON.apiVersion.replace(versionNumberRegexp, "$1" + sprint + "$3"); |
| 41 | + |
| 42 | + packageJSON.version = packageJSON.version.replace(versionNumberRegexp, "$1" + release + "$3"); |
| 43 | + packageJSON.apiVersion = packageJSON.apiVersion.replace(versionNumberRegexp, "$1" + release + "$3"); |
44 | 44 |
|
45 | 45 | common.writeJSON(grunt, path, packageJSON); |
46 | 46 | }); |
|
0 commit comments