Comparing version 0.4.6 to 0.4.7
var path = require('path'); | ||
var shell = require('../shell-utils'); | ||
var repeater = require('../repeater'); | ||
var prompt = require('prompt'); | ||
var prompt = require('../prompt-utils'); | ||
prompt.start(); | ||
prompt.message = prompt.delimiter = ''; | ||
module.exports = function(args){ | ||
var ticket = args._[1]; | ||
console.info( ("You are about to start development for a new ticket " + ticket).warning ); | ||
console.info( ("this will void all the uncommited changes in this project and every module").warning ); | ||
prompt.get(resetPrompt, function(err, result){ | ||
var moveForward = result.reset.match(/^y/i); | ||
if(moveForward){ | ||
repeater(command, function(){ | ||
}); | ||
} else { | ||
console.info('thank you for using cox'.success); | ||
process.exit(0) | ||
} | ||
}); | ||
@@ -35,6 +19,2 @@ var command = function(moduleName, moduleRepo, done){ | ||
var errors = shell.run([ | ||
'git reset --hard', | ||
'git checkout develop', | ||
'git pull origin develop', | ||
'git branch -D ' + ticket, | ||
'git checkout -b' + ticket | ||
@@ -52,13 +32,16 @@ ]); | ||
}; | ||
}; | ||
var resetPrompt = { | ||
properties: { | ||
reset: { | ||
description: 'are you sure you want to go through with this? (yes/no)'.prompt, | ||
required: true, | ||
pattern: /^(y|n|yes|no)$/i, | ||
message: 'please answer yes or no' | ||
} | ||
} | ||
//[TODO]: PROMISES!!! | ||
require('./reset')(args, function(){ | ||
require('./checkout')('develop', function(){ | ||
require('./pull')(args, function(){ | ||
args.b = ticket; | ||
require('./checkout')(args, function(){ | ||
console.info(('\n---------------------------------------------').success); | ||
console.info(('you can now start working on ticket ' + ticket).success); | ||
console.info(('---------------------------------------------\n').success); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}; |
@@ -10,8 +10,8 @@ var shelljs = require('shelljs/global'); | ||
// try{ | ||
try{ | ||
command = require( path.join(__dirname, 'commands', commandName ) ); | ||
// } catch(ex){ | ||
// console.error(('Error: there is no command ' + commandName + ' in cox').error); | ||
// process.exit(1); | ||
// } | ||
} catch(ex){ | ||
console.error(('Error: there is no command ' + commandName + ' in cox').error); | ||
process.exit(1); | ||
} | ||
@@ -18,0 +18,0 @@ command(args); |
{ | ||
"name": "cox", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"preferGlobal": "true", | ||
@@ -5,0 +5,0 @@ "description": "git commander for multi-repositories", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11396
16
265