mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Close GH-679: Prevent renaming of bower.json/component.json to index.json, fixes #674..
This commit is contained in:
@@ -113,7 +113,8 @@ FsResolver.prototype._rename = function () {
|
||||
// before checking its length
|
||||
files = files.filter(junk.isnt);
|
||||
|
||||
if (files.length === 1) {
|
||||
// Only rename if there's only one file and it's not the json
|
||||
if (files.length === 1 && !/^(bower|component)\.json$/.test(files[0])) {
|
||||
file = files[0];
|
||||
this._singleFile = 'index' + path.extname(file);
|
||||
oldPath = path.join(this._tempDir, file);
|
||||
|
||||
@@ -232,7 +232,8 @@ UrlResolver.prototype._rename = function () {
|
||||
// before checking its length
|
||||
files = files.filter(junk.isnt);
|
||||
|
||||
if (files.length === 1) {
|
||||
// Only rename if there's only one file and it's not the json
|
||||
if (files.length === 1 && !/^(component|bower)\.json$/.test(files[0])) {
|
||||
file = files[0];
|
||||
this._singleFile = 'index' + path.extname(file);
|
||||
oldPath = path.join(this._tempDir, file);
|
||||
|
||||
Reference in New Issue
Block a user