create-snappy 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -128,7 +128,8 @@ async function main() {
|
|
|
128
128
|
const response = await askQuestions();
|
|
129
129
|
if (!response.projectName) {
|
|
130
130
|
console.log(kleur2.yellow("Installation cancelled."));
|
|
131
|
-
process.exit(0);
|
|
131
|
+
setTimeout(() => process.exit(0), 100);
|
|
132
|
+
return;
|
|
132
133
|
}
|
|
133
134
|
console.log(kleur2.blue("\u{1F50D} Validating SNAPPY_TOKEN..."));
|
|
134
135
|
try {
|
|
@@ -136,7 +137,8 @@ async function main() {
|
|
|
136
137
|
console.log(kleur2.green(`\u2705 Token valid [Project: ${heartbeat.projectSlug || "Unknown"}]`));
|
|
137
138
|
} catch (err) {
|
|
138
139
|
console.error(kleur2.red(`\u274C Invalid SNAPPY_TOKEN: ${err.message}`));
|
|
139
|
-
process.exit(1);
|
|
140
|
+
setTimeout(() => process.exit(1), 100);
|
|
141
|
+
return;
|
|
140
142
|
}
|
|
141
143
|
const targetDir = path2.resolve(process.cwd(), response.projectName);
|
|
142
144
|
if (fs2.existsSync(targetDir)) {
|
|
@@ -148,7 +150,8 @@ async function main() {
|
|
|
148
150
|
});
|
|
149
151
|
if (!overwrite) {
|
|
150
152
|
console.log(kleur2.red("Aborted."));
|
|
151
|
-
process.exit(0);
|
|
153
|
+
setTimeout(() => process.exit(0), 100);
|
|
154
|
+
return;
|
|
152
155
|
}
|
|
153
156
|
fs2.rmSync(targetDir, { recursive: true, force: true });
|
|
154
157
|
}
|
|
@@ -164,11 +167,12 @@ Next steps:`);
|
|
|
164
167
|
} catch (err) {
|
|
165
168
|
console.error(kleur2.red(`
|
|
166
169
|
\u274C Installation failed: ${err.message}`));
|
|
167
|
-
process.exit(1);
|
|
170
|
+
setTimeout(() => process.exit(1), 100);
|
|
171
|
+
return;
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
174
|
main().catch((err) => {
|
|
171
175
|
console.error(kleur2.red(`
|
|
172
176
|
\u274C Critical error: ${err.message}`));
|
|
173
|
-
process.exit(1);
|
|
177
|
+
setTimeout(() => process.exit(1), 100);
|
|
174
178
|
});
|