Skip to content

Commit 0ea3b73

Browse files
committed
fix: Fix setup script
1 parent 22ff8d8 commit 0ea3b73

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

setup.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,6 @@ const rl = readline.createInterface({
1414
output: process.stdout,
1515
});
1616

17-
// checks and warns if setup was already completed
18-
if (fs.existsSync(setupCompletedFlag)) {
19-
console.log("\x1b[33m%s\x1b[0m", "Warning: Setup has already been completed once. Running it again may cause issues.");
20-
21-
rl.question("Do you want to proceed with the setup? (yes/no): ", (answer) => {
22-
if (answer.toLowerCase() !== "yes") {
23-
console.log("Setup aborted.");
24-
rl.close();
25-
process.exit(0);
26-
} else {
27-
console.log("Proceeding with setup...\n");
28-
startSetup();
29-
}
30-
});
31-
} else {
32-
startSetup();
33-
}
34-
3517
// prompts user for cleanup after setup
3618
const promptForCleanup = () => {
3719
rl.question("\nWould you like to delete this setup script and the completion flag? (yes/no): ", (answer) => {
@@ -142,4 +124,22 @@ const startSetup = () => {
142124
};
143125

144126
askQuestion(0);
145-
}
127+
}
128+
129+
// checks and warns if setup was already completed
130+
if (fs.existsSync(setupCompletedFlag)) {
131+
console.log("\x1b[33m%s\x1b[0m", "Warning: Setup has already been completed once. Running it again may cause issues.");
132+
133+
rl.question("Do you want to proceed with the setup? (yes/no): ", (answer) => {
134+
if (answer.toLowerCase() !== "yes") {
135+
console.log("Setup aborted.");
136+
rl.close();
137+
process.exit(0);
138+
} else {
139+
console.log("Proceeding with setup...\n");
140+
startSetup();
141+
}
142+
});
143+
} else {
144+
startSetup();
145+
}

0 commit comments

Comments
 (0)