diff --git a/cli.js b/cli.js index 16b3c98bd..c38a7eb88 100755 --- a/cli.js +++ b/cli.js @@ -48,7 +48,7 @@ process.on('uncaughtException', function(err) { ui.log('\n' + 'jspm run main Run a jspm module in Node\n' + '\n' - + 'jspm init [--prompts] Create / validate project configuration file\n' + + 'jspm init [basepath] [--prompts] Create / validate project configuration file\n' + '\n' + 'jspm install [--force skips cache] [--latest]\n' + ' install jquery Install a package from the registry to latest\n' @@ -242,7 +242,7 @@ process.on('uncaughtException', function(err) { if (options.yes) ui.useDefaults(); - core.init(options.prompts); + core.init(options.args[1], options.prompts); break; diff --git a/lib/core.js b/lib/core.js index 497f0261a..89c081094 100644 --- a/lib/core.js +++ b/lib/core.js @@ -314,7 +314,9 @@ exports.dlLoader = function(unminified, edge) { }); } -exports.init = function init(ask) { +exports.init = function init(basePath, ask) { + if (basePath) + process.env.jspmConfigPath = path.resolve(basePath, 'package.json'); return config.load(ask) .then(function() { return config.save();