mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
If cwd provided explicitly, force using it, fixes #1866
This commit is contained in:
@@ -13,6 +13,12 @@ var createError = require('../util/createError');
|
||||
function init(logger, config) {
|
||||
var project;
|
||||
|
||||
config = config || {};
|
||||
|
||||
if (!config.cwd) {
|
||||
config.cwd = process.cwd();
|
||||
}
|
||||
|
||||
config = defaultConfig(config);
|
||||
|
||||
// This command requires interactive to be enabled
|
||||
|
||||
@@ -10,9 +10,9 @@ var cachedConfigs = {};
|
||||
function defaultConfig(config) {
|
||||
config = config || {};
|
||||
|
||||
var cwd = path.dirname(findup('bower.json', {
|
||||
cwd: config.cwd || process.cwd()
|
||||
})) || config.cwd || process.cwd();
|
||||
var cwd = config.cwd || path.dirname(findup('bower.json', {
|
||||
cwd: process.cwd()
|
||||
})) || process.cwd();
|
||||
|
||||
config.cwd = cwd;
|
||||
|
||||
|
||||
@@ -93,4 +93,4 @@ module.exports = {
|
||||
postinstall: mout.function.partial(hook, 'postinstall', true),
|
||||
//only exposed for test
|
||||
_orderByDependencies: orderByDependencies
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user