Comparing version 0.1.0 to 0.2.0
var repeater = require('../repeater'); | ||
var nodegit = require('nodegit'); | ||
@@ -6,4 +7,6 @@ module.exports = function(args){ | ||
var command = 'git checkout -b ' + branch; | ||
var command = function(){ | ||
}; | ||
repeater(command, function(){ | ||
@@ -10,0 +13,0 @@ console.log('commands completed'); |
var path = require('path'); | ||
var command; | ||
// try{ | ||
try{ | ||
command = require( path.join(__dirname, 'commands', process.argv[2]) ); | ||
// } catch(e){ | ||
// console.error('Error: there is no command ' + process.argv[2] + ' in cox'); | ||
// process.exit(1); | ||
// } | ||
} catch(ex){ | ||
console.error('Error: there is no command ' + process.argv[2] + ' in cox'); | ||
process.exit(1); | ||
} | ||
command(process.argv) |
var fs = require('fs'); | ||
var path = require('path'); | ||
var modulesPath = path.join( process.cwd(), 'modules' ); | ||
module.exports = function(commands, callback){ | ||
commands = Array.isArray(commands)? commands : [commands]; | ||
commands.forEach(function(command, idx){ | ||
console.log('command', idx, command); | ||
}); | ||
try{ | ||
var pkg = require( path.join(process.cwd(), 'package.json') ); | ||
var dependencies = pkg.oetDependencies; | ||
if(typeof dependencies !== 'object'){ | ||
console.error('Error: no coxDependencies in package.json'); | ||
process.exit(1); | ||
} | ||
} catch(ex){ | ||
console.error('Error: not in a project folder - missing package.json'); | ||
process.exit(1); | ||
} | ||
var modules = []; | ||
var files = fs.readdirSync(modulesPath); | ||
files.forEach(function(file){ | ||
var fullPath = path.join(modulesPath, file); | ||
var stat = fs.statSync( fullPath ); | ||
if(stat.isDirectory()){ | ||
modules.push(fullPath); | ||
} | ||
}); | ||
console.log(modules); | ||
var repeater = module.exports = function(command, callback){ | ||
var modules = Object.keys(dependencies); | ||
(function traverse(){ | ||
var moduleName = modules.shift(); | ||
if(!moduleName){ | ||
return callback(); | ||
} | ||
var moduleRepo = dependencies[moduleName]; | ||
command(moduleName, moduleRepo, traverse); | ||
})(); | ||
}; | ||
{ | ||
"name": "cox", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"preferGlobal": "true", | ||
@@ -23,6 +23,12 @@ "description": "git commander for multi-repositories", | ||
"homepage": "https://github.com/andrepadez/cox", | ||
"directories": { | ||
"bin": "./bin" | ||
}, | ||
"dependencies": { | ||
"lodash": "^2.4.1", | ||
"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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
3545
8
89
5
3
+ Addedlodash@^2.4.1
+ Addedminimist@^1.1.0
+ Addednodegit@^0.2.4
+ Addedrimraf@^2.2.8
+ Addedshelljs@^0.3.0
+ Addedasap@1.0.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfind-parent-dir@0.3.1(transitive)
+ Addedfs-extra@0.14.0(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedjsonfile@2.4.0(transitive)
+ Addedlodash@2.4.2(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedncp@1.0.1(transitive)
+ Addednodegit@0.2.7(transitive)
+ Addednodegit-promise@1.0.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpromisify-node@0.1.5(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedshelljs@0.3.0(transitive)
+ Addedwrappy@1.0.2(transitive)