mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Merge pull request #38 from bower/revert-36-master
Revert "updated to respect the bowerrc in the cwd passed in as command line argument"
This commit is contained in:
@@ -31,8 +31,6 @@ function rc(name, cwd, argv) {
|
||||
json(find('.' + name + 'rc', cwd)),
|
||||
env('npm_package_config_' + name + '_'),
|
||||
env(name + '_'),
|
||||
// If we have specified a cwd then the bowerrc from there takes precedence
|
||||
!argvConfig.cwd ? {} : json(path.join(argvConfig.cwd, '.' + name + 'rc')),
|
||||
argvConfig
|
||||
]);
|
||||
} else {
|
||||
@@ -44,8 +42,6 @@ function rc(name, cwd, argv) {
|
||||
json(path.join(paths.config, name + 'rc')),
|
||||
env('npm_package_config_' + name + '_'),
|
||||
env(name + '_'),
|
||||
// If we have specified a cwd then the bowerrc from there takes precedence
|
||||
!argvConfig.cwd ? {} : json(path.join(argvConfig.cwd, '.' + name + 'rc')),
|
||||
argvConfig
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -20,16 +20,13 @@ describe('rc', function() {
|
||||
'child3/bower.json': {
|
||||
name: 'without-bowerrc'
|
||||
},
|
||||
'other_dir/.bowerrc': {
|
||||
key: 'othervalue'
|
||||
}
|
||||
});
|
||||
|
||||
tempDirBowerrc.prepare({
|
||||
'.bowerrc/foo': {
|
||||
key: 'bar'
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
it('correctly reads .bowerrc files', function() {
|
||||
@@ -60,19 +57,6 @@ describe('rc', function() {
|
||||
expect(config.key2).to.eql(undefined);
|
||||
});
|
||||
|
||||
it('loads the .bowerrc file from the cwd specified on the command line', function(){
|
||||
var argv = {
|
||||
'config': {
|
||||
'cwd': tempDir.path + '/other_dir/'
|
||||
}
|
||||
};
|
||||
|
||||
var config = rc('bower', tempDir.path, argv);
|
||||
|
||||
expect(config.key).to.eql('othervalue');
|
||||
|
||||
});
|
||||
|
||||
it('throws an easy to understand error if .bowerrc is a dir', function() {
|
||||
// Gotta wrap this to catch the error
|
||||
var config = function () {
|
||||
|
||||
Reference in New Issue
Block a user