Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
Fix error with renaming files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ofrogon committed Apr 30, 2016
1 parent 4c0bafc commit ec8bce2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/fileManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,11 @@ FileObj.prototype = {
}

for (var x = 0, y = pkgs[pkg].length; x < y; x++) {
var fileNameAndExt = pkgs[pkg][x] || "*",
fileFolder = pkg.split("#")[1] || "",
extName = path.extname(fileNameAndExt),
fileName = path.basename(fileNameAndExt, extName),
var p = pkg.split("#"),
fileNameAndExt = pkgs[pkg][x] || "*",
fileFolder = p[1] || "",
extName = path.extname(p[0]),
fileName = path.basename(p[0], extName),
extension = extName.substr(1);

if (this.extToIgnore.indexOf(extension) === -1) {
Expand Down Expand Up @@ -245,7 +246,11 @@ FileObj.prototype = {

for (var i = 0, length = files.length; i < length; i++) {
f = path.normalize(files[i]);
var thisFile = (regex.containAsterisk.test(files[i]) ? fileName : path.basename(f, path.extname(f)));
if (regex.containAsterisk.test(files[i]) || fileName !== "*") {
var thisFile = fileName;
} else {
var thisFile = path.basename(f, path.extname(f));
}

// Try to find the min file here
if (this.getMin && !regex.containMin.test(f)) {
Expand Down

0 comments on commit ec8bce2

Please sign in to comment.