Skip to content

Commit 1873934

Browse files
committed
add exit if error fired
1 parent 2aa609f commit 1873934

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ const { copyFileSync } = require('node:fs');
55

66
if (process.argv.length !== 4) {
77
console.error('Script accepts 2 arguments');
8+
process.exit(0);
89
}
910

1011
const [, , sourceFile, destinationFile] = process.argv;
1112

1213
if (sourceFile === destinationFile) {
1314
console.error('Can`t copy to the same location');
15+
process.exit(0);
1416
}
1517

1618
try {

0 commit comments

Comments
 (0)