Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
First crack at something resembling a fix for #74
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Aug 26, 2010
1 parent 329fa34 commit 2dbaf0d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

module.exports = bundle

var npm = require("../npm")
, fs = require("fs")
, path = require("path")
, log = require("./utils/log")
function bundle (args, cb) {
log(args, "bundle")
var location = args.pop()
, usage = "Usage: npm bundle [<pkg> [<pkg> ...]] <location>"
if (!location) return cb(new Error(usage))
if (location.charAt(0) !== "/") {
location = path.join(process.cwd(), location)
}
fs.stat(location, function (er, s) {
if (er || !s.isDirectory()) return cb(new Error(usage))
npm.config.set("root", location)
npm.config.set("binroot", null)
npm.commands.install(args, cb)
})
}
1 change: 1 addition & 0 deletions npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var commandCache = {}
, "view"
, "repl"
, "rebuild"
, "bundle"
].forEach(function (c) {
Object.defineProperty(npm.commands, c, { get : function () {
c = c === "list" ? "ls"
Expand Down

0 comments on commit 2dbaf0d

Please sign in to comment.