Keep original if statement order

This commit is contained in:
Lucas Bustamante 2022-01-26 13:35:03 -03:00
parent 15291424e2
commit e1ca45e07d
1 changed files with 3 additions and 3 deletions

View File

@ -55,11 +55,11 @@ const confirmLocalCopy = ( localE2ePath, packageE2ePath, packageName = '', force
const confirmPrompt = `${localE2ePath} already exists. Overwrite? [Y]es/[n]o: `; const confirmPrompt = `${localE2ePath} already exists. Overwrite? [Y]es/[n]o: `;
let overwriteFiles; let overwriteFiles;
if ( !fs.existsSync( localPath ) || force ) { if ( ! force && fs.existsSync( localPath ) ) {
overwriteFiles = 'y';
} else {
overwriteFiles = confirm( confirmPrompt, 'ny' ); overwriteFiles = confirm( confirmPrompt, 'ny' );
overwriteFiles = overwriteFiles.toLowerCase(); overwriteFiles = overwriteFiles.toLowerCase();
} else {
overwriteFiles = 'y';
} }
if ( overwriteFiles == 'y' ) { if ( overwriteFiles == 'y' ) {
fs.copyFileSync( packagePath, localPath ); fs.copyFileSync( packagePath, localPath );