Socket
Socket
Sign inDemoInstall

cox

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cox - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

.npmignore

5

lib/commands/branch.js
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');

10

lib/cox.js
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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc