Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 470f78f

Browse files
fix: tweak
closes #156
1 parent 67db6a1 commit 470f78f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.bin/create-rust-webpack.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,17 @@ if (!isPresent("git --version")) {
3232
process.exit(1);
3333
}
3434

35-
let folderName = '.';
35+
const args = process.argv.slice(2);
3636

37-
if (process.argv.length >= 3) {
38-
folderName = process.argv[2];
37+
if (args.some(arg => arg.includes('-'))) {
38+
console.log(`Error: unknown option ${args[0]}`);
39+
process.exit(1);
40+
}
41+
42+
let folderName = '.';
43+
console.log(args.length);
44+
if (args.length >= 1) {
45+
folderName = args[2];
3946
if (!fs.existsSync(folderName)) {
4047
fs.mkdirSync(folderName);
4148
}

0 commit comments

Comments
 (0)