Comparing version 0.0.13 to 0.0.14
#!/usr/bin/env node | ||
var doc = '' + | ||
'Usage: \n' + | ||
' croc ls [options] [<package>...] \n' + | ||
' croc deps [options] [<package>...] \n' + | ||
' croc ls [-c -s SHA] [-px] [--json] [<package>...] \n' + | ||
' croc deps [-c -s SHA] [-px] [--json] [<package>...] \n' + | ||
' croc link [--strict] \n' + | ||
@@ -11,4 +11,4 @@ ' croc install \n' + | ||
' croc publish \n' + | ||
' croc exec CMD [<package>...] \n' + | ||
' croc pexec CMD [<package>...] \n' + | ||
' croc [-cp] exec CMD [<package>...] \n' + | ||
' croc [-cp] pexec CMD [<package>...] \n' + | ||
' \n' + | ||
@@ -19,5 +19,6 @@ 'Options: \n' + | ||
' --json Show information in JSON format. \n' + | ||
' -p, --predecessors Include procets depending on the packages. \n' + | ||
' -x, --strict Dependencies must statisfy version (semver) \n' + | ||
' -c, --changed Show only projects that is changed. \n' + | ||
' -s, --since=SHA Commit to diff against [default: master] \n' + | ||
' --strict Dependencies must statisfy version (semver) \n' | ||
' -s, --since=SHA Commit to diff against [default: master] \n' | ||
@@ -33,7 +34,19 @@ var docopt = require('docopt').docopt | ||
var pkgs = deps.packages({strict: args['--strict'], | ||
packages: args['<package>']}) | ||
var pkgs = deps.packages(args['--strict']) | ||
var includePkgs | ||
if (args['<package>'].length > 0) { | ||
includePkgs = args['<package>'] | ||
} else { | ||
includePkgs = pkgs.nodes() | ||
} | ||
if (args['--changed']) { | ||
pkgs = git.changed(pkgs, args['--since']) | ||
includePkgs = git.changed(pkgs, includePkgs, args['--since']) | ||
} | ||
if (args['--predecessors']) { | ||
includePkgs = includePkgs.concat(deps.getPredecessors(pkgs, includePkgs)) | ||
} | ||
pkgs = pkgs.filter(function (name) { | ||
return includePkgs.indexOf(name) >= 0 | ||
}) | ||
if (args.ls) { | ||
@@ -54,9 +67,9 @@ if (args['--json']) { | ||
} else if (args.test) { | ||
exec.exec(pkgs, 'npm test') | ||
exec.pexec(pkgs, 'npm test') | ||
} else if (args.build) { | ||
exec.exec(pkgs, 'npm run build') | ||
exec.pexec(pkgs, 'npm run build') | ||
} else if (args.install) { | ||
exec.exec(pkgs, 'npm install') | ||
exec.pexec(pkgs, 'npm install') | ||
} else if (args.publish) { | ||
exec.exec(pkgs, 'npm show %PKG_NAME% versions --json | grep -q \\"%PKG_VERSION%\\" || npm publish') | ||
exec.pexec(pkgs, 'npm show %PKG_NAME% versions --json | grep -q \\"%PKG_VERSION%\\" || npm publish') | ||
} else if (args.exec) { | ||
@@ -63,0 +76,0 @@ exec.exec(pkgs, args.CMD) |
{ | ||
"name": "croc", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "monolithic repository manager", | ||
@@ -5,0 +5,0 @@ "bin": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6897
123
1