create-rspress 1.8.2 → 1.8.3
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 +6 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8137,8 +8137,12 @@ function initSitePrompts(options) {
|
|
|
8137
8137
|
return option;
|
|
8138
8138
|
};
|
|
8139
8139
|
options.forEach(initOptionEvent);
|
|
8140
|
-
return (0, import_prompts.default)(options);
|
|
8140
|
+
return (0, import_prompts.default)(options, { onCancel: cancelPrompt });
|
|
8141
8141
|
}
|
|
8142
|
+
var cancelPrompt = () => {
|
|
8143
|
+
console.log("Operation cancelled.");
|
|
8144
|
+
process.exit(0);
|
|
8145
|
+
};
|
|
8142
8146
|
|
|
8143
8147
|
// src/index.ts
|
|
8144
8148
|
var cli = cac("create-rspress").help();
|
|
@@ -8171,7 +8175,7 @@ cli.command("", "Create a new rspress site").action(async () => {
|
|
|
8171
8175
|
targetDir = formatTargetDir(state.value) || defaultProjectName;
|
|
8172
8176
|
}
|
|
8173
8177
|
}
|
|
8174
|
-
]);
|
|
8178
|
+
], { onCancel: cancelPrompt });
|
|
8175
8179
|
await promptProjectDir();
|
|
8176
8180
|
let root = import_path2.default.resolve(process.cwd(), targetDir);
|
|
8177
8181
|
while (import_fs_extra2.default.existsSync(root)) {
|