Created
February 21, 2013 03:19
-
-
Save geta6/5001766 to your computer and use it in GitHub Desktop.
link all npm modules in package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env coffee | |
fs = require 'fs' | |
path = require 'path' | |
util = require 'util' | |
{exec} = require 'child_process' | |
unless fs.existsSync 'package.json' | |
console.log 'Not found `package.json`' | |
process.exit 1 | |
else | |
pkg = require path.resolve 'package.json' | |
for k, v of pkg.dependencies | |
unless v.match /^git:/ | |
console.log "link #{k}..." | |
exec "npm link #{k}", (err, stdout, stderr) -> | |
#util.print stdout if stdout | |
util.print stderr if stderr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment