@cloud411716/fancy-webnovel 1.0.37 → 1.0.39
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 +16 -11
- package/index.js +2 -2
- package/package.json +1 -1
|
@@ -103,17 +103,22 @@ export function apply(ctx) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
// ---------- confirm ----------
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
106
|
+
let confirm;
|
|
107
|
+
try {
|
|
108
|
+
confirm = await ctx.userQuestions.ask({
|
|
109
|
+
questions: [{
|
|
110
|
+
id: 'confirm',
|
|
111
|
+
question: bootstrap.notify({ type: 'confirm', projectRoot }),
|
|
112
|
+
detail: projectRoot,
|
|
113
|
+
hideCustomInput: true,
|
|
114
|
+
options: bootstrap.confirmOptions(),
|
|
115
|
+
}],
|
|
116
|
+
agent: invocation.agent,
|
|
117
|
+
signal,
|
|
118
|
+
});
|
|
119
|
+
} catch {
|
|
120
|
+
return notify(session, 'error', bootstrap.notify({ type: 'cancelled' }));
|
|
121
|
+
}
|
|
117
122
|
const ans = confirm.answers[0];
|
|
118
123
|
const chosen = ans?.selected?.[0] ?? ans?.custom;
|
|
119
124
|
if (chosen !== '确认创建') {
|
package/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* - File operations use Node.js fs (project roots may be outside workspace).
|
|
13
13
|
* - ctx.timer (via ctx.timeout()) handles all delays/timeouts.
|
|
14
14
|
*
|
|
15
|
-
* Required Cordis services: commands, userQuestions, timer,
|
|
15
|
+
* Required Cordis services: commands, userQuestions, timer, fs
|
|
16
16
|
* (all are part of dsh-base, so this plugin works on dsh-tui, dsh-web, dsh-desktop).
|
|
17
17
|
*
|
|
18
18
|
* IMPORTANT: This plugin needs `danger-full-access` sandbox mode because it
|
|
@@ -27,7 +27,7 @@ import { apply as applyScan } from './commands/scan/index.js';
|
|
|
27
27
|
* Services this plugin requires from the Cordis context.
|
|
28
28
|
* All are provided by dsh-base, so this works on every DSH UI.
|
|
29
29
|
*/
|
|
30
|
-
export const inject = ['commands', 'userQuestions', 'timer', '
|
|
30
|
+
export const inject = ['commands', 'userQuestions', 'timer', 'fs'];
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Called once when the plugin is loaded into a Cordis context (fiber).
|