scan-debug-skill 1.0.0 → 1.0.1
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/README.md +1 -1
- package/bin/install.js +23 -9
- package/package.json +1 -1
package/README.md
CHANGED
package/bin/install.js
CHANGED
|
@@ -129,33 +129,47 @@ let defaultText = 'Trae';
|
|
|
129
129
|
if (hasCursor && !hasTrae) {
|
|
130
130
|
defaultChoice = '2';
|
|
131
131
|
defaultText = 'Cursor';
|
|
132
|
-
} else if (hasTrae && hasCursor) {
|
|
133
|
-
defaultChoice = '3';
|
|
134
|
-
defaultText = 'Both';
|
|
135
132
|
}
|
|
133
|
+
// 若两者都存在,默认保持为 1 (Trae)
|
|
136
134
|
|
|
137
135
|
console.log('请选择要安装的目标 IDE (Please select target IDE):');
|
|
138
136
|
console.log(`1. Trae (.trae/scan-debug-skill) ${hasTrae ? '[Detected]' : ''}`);
|
|
139
137
|
console.log(`2. Cursor (.cursor/scan-debug-skill) ${hasCursor ? '[Detected]' : ''}`);
|
|
140
|
-
console.log('3.
|
|
138
|
+
console.log('3. Custom (指定目录/Custom Directory)');
|
|
141
139
|
|
|
142
140
|
rl.question(`请输入选项 (1/2/3) [默认: ${defaultChoice} (${defaultText})]: `, (answer) => {
|
|
143
141
|
const choice = answer.trim() || defaultChoice;
|
|
144
142
|
|
|
143
|
+
// 选项 3:自定义目录
|
|
144
|
+
if (choice === '3') {
|
|
145
|
+
rl.question('请输入目标安装目录 (Please enter target directory): ', (inputPath) => {
|
|
146
|
+
const targetDir = inputPath.trim();
|
|
147
|
+
if (targetDir) {
|
|
148
|
+
// 处理相对路径和绝对路径
|
|
149
|
+
const finalPath = path.isAbsolute(targetDir) ? targetDir : path.resolve(cwd, targetDir);
|
|
150
|
+
install(finalPath);
|
|
151
|
+
} else {
|
|
152
|
+
console.log('❌ 未输入路径,已取消 (No path provided, cancelled).');
|
|
153
|
+
}
|
|
154
|
+
rl.close();
|
|
155
|
+
});
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
145
159
|
// 映射选择到目标目录
|
|
146
160
|
const targets = [];
|
|
147
161
|
|
|
148
|
-
// 选项 1
|
|
149
|
-
if (choice === '1'
|
|
162
|
+
// 选项 1:安装到 Trae
|
|
163
|
+
if (choice === '1') {
|
|
150
164
|
targets.push(path.join(cwd, '.trae', 'scan-debug-skill'));
|
|
151
165
|
}
|
|
152
166
|
|
|
153
|
-
// 选项 2
|
|
154
|
-
if (choice === '2'
|
|
167
|
+
// 选项 2:安装到 Cursor
|
|
168
|
+
if (choice === '2') {
|
|
155
169
|
targets.push(path.join(cwd, '.cursor', 'scan-debug-skill'));
|
|
156
170
|
}
|
|
157
171
|
|
|
158
|
-
//
|
|
172
|
+
// 如果没有有效选择(且不是3),回退到默认
|
|
159
173
|
if (targets.length === 0) {
|
|
160
174
|
if (defaultChoice === '2') {
|
|
161
175
|
targets.push(path.join(cwd, '.cursor', 'scan-debug-skill'));
|