mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 08:54:10 +00:00
feature(cl) save Version after first call
This commit is contained in:
parent
de30cfd10a
commit
f630a95b23
1 changed files with 6 additions and 5 deletions
11
gulp/cl.js
11
gulp/cl.js
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
var DIR = '../',
|
||||
minor = require('minor'),
|
||||
Info = require(DIR + 'package');
|
||||
Info = require(DIR + 'package'),
|
||||
Version;
|
||||
|
||||
exports.getVersion = function() {
|
||||
var versionNew,
|
||||
|
|
@ -12,17 +13,17 @@
|
|||
last = process.argv[length],
|
||||
regExp = /^--(major|minor|patch)?/,
|
||||
match = last.match(regExp);
|
||||
|
||||
if (regExp.test(last)) {
|
||||
|
||||
if (!Version && regExp.test(last)) {
|
||||
if (match[1])
|
||||
versionNew = minor(match[1], Info.version);
|
||||
else
|
||||
versionNew = last.substr(3);
|
||||
|
||||
console.log(versionNew);
|
||||
Version = versionNew;
|
||||
}
|
||||
|
||||
return versionNew;
|
||||
return Version;
|
||||
};
|
||||
|
||||
exports.showVersionError = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue