@cloud411716/fancy-webnovel 1.0.34 → 1.0.36
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/commands/bootstrap/index.js +11 -16
- package/commands/scan/index.js +6 -1
- package/package.json +1 -1
|
@@ -103,22 +103,17 @@ export function apply(ctx) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
// ---------- confirm ----------
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
signal,
|
|
118
|
-
});
|
|
119
|
-
} catch {
|
|
120
|
-
return notify(session, 'error', bootstrap.notify({ type: 'cancelled' }));
|
|
121
|
-
}
|
|
106
|
+
const confirm = await ctx.userQuestions.ask({
|
|
107
|
+
questions: [{
|
|
108
|
+
id: 'confirm',
|
|
109
|
+
question: bootstrap.notify({ type: 'confirm', projectRoot }),
|
|
110
|
+
detail: projectRoot,
|
|
111
|
+
hideCustomInput: true,
|
|
112
|
+
options: bootstrap.confirmOptions(),
|
|
113
|
+
}],
|
|
114
|
+
agent: invocation.agent,
|
|
115
|
+
signal,
|
|
116
|
+
});
|
|
122
117
|
const ans = confirm.answers[0];
|
|
123
118
|
const chosen = ans?.selected?.[0] ?? ans?.custom;
|
|
124
119
|
if (chosen !== '确认创建') {
|
package/commands/scan/index.js
CHANGED
|
@@ -55,7 +55,7 @@ const scan = {
|
|
|
55
55
|
detail: opts.map(o => o.label).join('、'),
|
|
56
56
|
hideCustomInput: true,
|
|
57
57
|
multiSelect: true,
|
|
58
|
-
options: opts,
|
|
58
|
+
options: [...opts, { id: 'cancel', label: '取消' }],
|
|
59
59
|
};
|
|
60
60
|
},
|
|
61
61
|
|
|
@@ -173,6 +173,11 @@ export function apply(ctx) {
|
|
|
173
173
|
const selected = rankResult.answers[0]?.selected ?? [];
|
|
174
174
|
const custom = rankResult.answers[0]?.custom?.trim();
|
|
175
175
|
|
|
176
|
+
// "取消" is an explicit option — treat it as cancelled like bootstrap
|
|
177
|
+
if (selected.includes('取消')) {
|
|
178
|
+
return notify(session, 'error', scan.notify({ type: 'cancelled' }));
|
|
179
|
+
}
|
|
180
|
+
|
|
176
181
|
const rawChoices = selected.length > 0 ? selected : (custom ? [custom] : []);
|
|
177
182
|
if (rawChoices.length === 0) {
|
|
178
183
|
return notify(session, 'error', scan.notify({ type: 'cancelled' }));
|