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 CHANGED
@@ -17,7 +17,7 @@ npx scan-debug-skill
17
17
 
18
18
  1. **Trae**:安装到 `.trae/scan-debug-skill`
19
19
  2. **Cursor**:安装到 `.cursor/scan-debug-skill`
20
- 3. **Both**:同时安装到上述两个位置
20
+ 3. **Custom**:安装到指定目录
21
21
 
22
22
  ### 包含的内容
23
23
 
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. Both (同时安装/Install Both)');
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 或 3:安装到 Trae
149
- if (choice === '1' || choice === '3') {
162
+ // 选项 1:安装到 Trae
163
+ if (choice === '1') {
150
164
  targets.push(path.join(cwd, '.trae', 'scan-debug-skill'));
151
165
  }
152
166
 
153
- // 选项 2 或 3:安装到 Cursor
154
- if (choice === '2' || choice === '3') {
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'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scan-debug-skill",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "ScanDebugSkill for Trae IDE - Easily install debugging skills via npx",
5
5
  "bin": {
6
6
  "scan-debug-skill": "./bin/install.js"