sillyspec 3.7.12 → 3.7.13

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/init.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sillyspec",
3
- "version": "3.7.12",
3
+ "version": "3.7.13",
4
4
  "description": "SillySpec CLI — 流程状态机,让 AI 严格按步骤来",
5
5
  "type": "module",
6
6
  "bin": {
package/src/init.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, copyFileSync } from 'fs';
2
- import { join, resolve, dirname } from 'path';
2
+ import { join, resolve, dirname, basename } from 'path';
3
3
  import { fileURLToPath } from 'url';
4
4
  import { homedir } from 'os';
5
5
  import { checkbox, select, confirm, input } from '@inquirer/prompts';
@@ -209,7 +209,7 @@ async function doInstall(projectDir, tools, isWorkspace, subprojects = []) {
209
209
  // .sillyspec/.runtime/ → progress (gitignored)
210
210
 
211
211
  // 注册当前项目到 projects/
212
- const projectName = projectDir.split('/').pop() || projectDir.split('\\').pop() || 'project';
212
+ const projectName = basename(projectDir) || 'project';
213
213
  const projectsDir = join(projectDir, '.sillyspec', 'projects');
214
214
  mkdirSync(projectsDir, { recursive: true });
215
215
  const projectYamlPath = join(projectsDir, `${projectName}.yaml`);