sillyspec 3.7.4 → 3.7.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/setup.js +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sillyspec",
3
- "version": "3.7.4",
3
+ "version": "3.7.6",
4
4
  "description": "SillySpec CLI — 流程状态机,让 AI 严格按步骤来",
5
5
  "type": "module",
6
6
  "bin": {
package/src/setup.js CHANGED
@@ -1,10 +1,14 @@
1
1
  import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync } from 'fs';
2
2
  import { join, dirname } from 'path';
3
+ import { fileURLToPath } from 'url';
3
4
  import { execSync } from 'child_process';
4
5
  import chalk from 'chalk';
5
6
  import ora from 'ora';
6
7
  import { checkbox, confirm, input, select } from '@inquirer/prompts';
7
8
 
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+
8
12
  // ── Skill 定义 ──
9
13
 
10
14
  const SKILLS = [
@@ -383,6 +387,7 @@ export async function cmdSetup(dir, options = {}) {
383
387
  const spinner = ora(`安装 ${skill.name}...`).start();
384
388
  try {
385
389
  const targetDir = join(dir, skill.target);
390
+ mkdirSync(targetDir, { recursive: true });
386
391
  cpSync(skill.source, targetDir, { recursive: true });
387
392
  spinner.succeed(`${skill.name} 安装完成 → ${skill.target}/SKILL.md`);
388
393
  } catch (err) {