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
882271dc60
commit
09734d7879
|
@ -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