@k2works/claude-code-booster 0.1.2 → 0.1.3
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/bin/claude-code-booster +19 -16
- package/package.json +1 -1
package/bin/claude-code-booster
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const { exec } = require('child_process');
|
|
4
3
|
const path = require('path');
|
|
4
|
+
const fs = require('fs-extra');
|
|
5
|
+
|
|
6
|
+
const TEMPLATE_DIR = 'lib/assets';
|
|
7
|
+
|
|
8
|
+
async function setupProject() {
|
|
9
|
+
// プロジェクトのルートディレクトリのパスを取得する
|
|
10
|
+
const projectDir = process.env.INIT_CWD || process.cwd();
|
|
5
11
|
|
|
6
|
-
const setupProject = () => {
|
|
7
12
|
// パッケージのルートディレクトリのパスを取得する
|
|
8
13
|
const packageDir = path.join(__dirname, '..');
|
|
9
14
|
|
|
10
|
-
//
|
|
11
|
-
const
|
|
12
|
-
const gulpCommand = `npx gulp --gulpfile "${gulpfilePath}"`;
|
|
13
|
-
|
|
14
|
-
// child_processモジュールのexec関数を使用して、gulpコマンドを実行する
|
|
15
|
-
const child = exec(gulpCommand);
|
|
15
|
+
// テンプレートファイルが含まれるディレクトリのパスを取得する
|
|
16
|
+
const templateDir = path.join(packageDir, TEMPLATE_DIR);
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
try {
|
|
19
|
+
// テンプレートファイルをプロジェクトのルートディレクトリにコピーする
|
|
20
|
+
await fs.copy(templateDir, projectDir, { overwrite: true, errorOnExist: false });
|
|
21
|
+
console.log(`[claude-code-booster] Copied assets from "${templateDir}" to "${projectDir}"`);
|
|
22
|
+
} catch (err) {
|
|
23
|
+
console.error('[claude-code-booster] Asset copy failed:', err);
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
21
27
|
|
|
22
|
-
//
|
|
23
|
-
child.stderr.on('data', (data) => {
|
|
24
|
-
console.error(data);
|
|
25
|
-
});
|
|
28
|
+
// 追加のセットアップ処理があればここに記述
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
setupProject();
|