Comparing version 0.4.1 to 0.4.2
var repeater = require('../repeater'); | ||
var nodegit = require('nodegit'); | ||
var nodegitOptions = require('../nodegitoptions'); | ||
module.exports = function(args){ | ||
var branch = args[3]; | ||
var command = function(moduleName, moduleRepo, done){ | ||
var command = function(){ | ||
}; | ||
repeater(command, function(){ | ||
console.log('commands completed'); | ||
}) | ||
}; |
@@ -0,5 +1,3 @@ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var rmdir = require('rimraf'); | ||
var NodeGit = require('nodegit'); | ||
var clone = NodeGit.Clone.clone; | ||
var repeater = require('../repeater'); | ||
@@ -13,26 +11,27 @@ var nodegitOptions = require('../nodegitoptions'); | ||
//[TODO] check args for different module folder | ||
var modulesPresent = ls(process.cwd()).indexOf(modulesDir) > -1; | ||
if(!modulesPresent){ | ||
mkdir(modulesDir); | ||
} | ||
var installedModules = ls(modulesDir); | ||
var command = function(moduleName, moduleRepo, done){ | ||
console.info( ('cloning ' + moduleName + ' from ' + moduleRepo).action ); | ||
var options = nodegitOptions.get(); | ||
clone(moduleRepo, 'modules/' + moduleName, options).then(function(){ | ||
console.info( (moduleName + ' has been cloned in folder ' + modulesDir).success ); | ||
done(); | ||
}, function(err){ | ||
console.error(err); | ||
if(installedModules.indexOf(moduleName) > -1){ | ||
console.info( (moduleName + ' is already present in folder ' + modulesDir).warning ); | ||
return done(); | ||
} | ||
if(exec('git clone ' + moduleRepo + ' modules/' + moduleName).code !== 0){ | ||
console.error('there was a fatal error cloning this repository'.error); | ||
process.exit(1); | ||
}); | ||
} | ||
console.info( (moduleName + ' has been cloned in folder ' + modulesDir).success ); | ||
done(); | ||
}; | ||
rmdir( path.join(process.cwd(), modulesDir), function(err){ | ||
if(err){ | ||
return console.log(err.error); | ||
process.exit(1); | ||
} | ||
repeater(command, function(){ | ||
console.log('cox has successfully run the task install'.success); | ||
npmCommand('install'); | ||
}); | ||
repeater(command, function(){ | ||
console.log('cox has successfully run the task install'.success); | ||
npmCommand('install'); | ||
}); | ||
}; |
var path = require('path'); | ||
var shelljs = require('shelljs/global'); | ||
var repeater = require('../repeater'); | ||
@@ -9,5 +8,2 @@ var _ = require('lodash'); | ||
console.log('subcommand', subCommand); | ||
console.info('starting task npm ' + subCommand) | ||
var command = function(moduleName, moduleRepo, done){ | ||
@@ -25,4 +21,4 @@ console.info(('cox is running npm ' + subCommand + ' for the ' + moduleName + ' module').action ); | ||
if (exec('npm ' + subCommand).code !== 0) { | ||
console.error( ('Error: npm install didn\'t run for ' + moduleName).error); | ||
process.exit(1); | ||
console.error( ('Error: npm install didn\'t run for ' + moduleName).error); | ||
process.exit(1); | ||
} | ||
@@ -34,5 +30,12 @@ console.info( ('successfully ran npm ' + subCommand + ' on module ' + moduleName).success); | ||
console.info('starting task npm ' + subCommand); | ||
repeater(command, function(){ | ||
//run for the command in the main project folder | ||
console.info( ('running npm ' + subCommand + ' in ' + process.cwd() ).action); | ||
if (exec('npm ' + subCommand).code !== 0) { | ||
console.error( ('Error: npm install didn\'t run for ' + moduleName).error); | ||
process.exit(1); | ||
} | ||
console.log( ('cox has successfully run the task npm ' + subCommand).success); | ||
}); | ||
}; |
@@ -0,1 +1,2 @@ | ||
var shelljs = require('shelljs/global'); | ||
var path = require('path'); | ||
@@ -2,0 +3,0 @@ var parseArgs = require('minimist'); |
{ | ||
"name": "cox", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"preferGlobal": "true", | ||
@@ -30,6 +30,4 @@ "description": "git commander for multi-repositories", | ||
"minimist": "^1.1.0", | ||
"nodegit": "^0.2.4", | ||
"rimraf": "^2.2.8", | ||
"shelljs": "^0.3.0" | ||
} | ||
} |
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
5516
4
5
- Removednodegit@^0.2.4
- Removedrimraf@^2.2.8
- Removedasap@1.0.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedfind-parent-dir@0.3.1(transitive)
- Removedfs-extra@0.14.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedjsonfile@2.4.0(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedncp@1.0.1(transitive)
- Removednodegit@0.2.7(transitive)
- Removednodegit-promise@1.0.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpromisify-node@0.1.5(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedwrappy@1.0.2(transitive)