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