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.
- package/package.json +1 -1
- package/src/setup.js +5 -0
package/package.json
CHANGED
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) {
|