call path.basename w/ extension name to avoid e.g. `.js.1.js`
This commit is contained in:
parent
882271dc60
commit
09734d7879
|
@ -120,9 +120,10 @@ function copyPreserve(sourceFilePath, targetFilePath) {
|
||||||
let ext = 1;
|
let ext = 1;
|
||||||
let preserved = targetFilePath;
|
let preserved = targetFilePath;
|
||||||
while (fs.existsSync(preserved)) {
|
while (fs.existsSync(preserved)) {
|
||||||
|
let extname = path.extname(targetFilePath);
|
||||||
preserved = utils.joinPath(
|
preserved = utils.joinPath(
|
||||||
path.dirname(targetFilePath),
|
path.dirname(targetFilePath),
|
||||||
`${path.basename(targetFilePath)}.${ext}${path.extname(targetFilePath)}`
|
`${path.basename(targetFilePath, extname)}.${ext}${extname}`
|
||||||
);
|
);
|
||||||
ext++;
|
ext++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue