claude-flow-novice 2.3.4 → 2.3.5
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/dist/scripts/postinstall.js +6 -30
- package/package.json +1 -1
- package/scripts/postinstall.js +6 -30
|
@@ -2,41 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Post-installation script for claude-flow-novice
|
|
5
|
-
* Copies .claude directory from
|
|
6
|
-
*
|
|
5
|
+
* Copies .claude directory from package to project root
|
|
6
|
+
* Overwrites existing files to ensure updates work correctly
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { existsSync,
|
|
10
|
-
import { dirname, join
|
|
9
|
+
import { existsSync, cpSync } from 'fs';
|
|
10
|
+
import { dirname, join } from 'path';
|
|
11
11
|
import { fileURLToPath } from 'url';
|
|
12
12
|
|
|
13
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
14
14
|
const __dirname = dirname(__filename);
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
* Simple recursive copy - overwrites existing files
|
|
18
|
-
*/
|
|
19
|
-
function simpleCopy(source, target) {
|
|
20
|
-
if (!existsSync(source)) return;
|
|
21
|
-
|
|
22
|
-
const stat = statSync(source);
|
|
23
|
-
|
|
24
|
-
if (stat.isDirectory()) {
|
|
25
|
-
// Create directory if it doesn't exist
|
|
26
|
-
if (!existsSync(target)) {
|
|
27
|
-
mkdirSync(target, { recursive: true });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Copy contents
|
|
31
|
-
const entries = readdirSync(source);
|
|
32
|
-
for (const entry of entries) {
|
|
33
|
-
simpleCopy(join(source, entry), join(target, entry));
|
|
34
|
-
}
|
|
35
|
-
} else {
|
|
36
|
-
// File - always overwrite
|
|
37
|
-
copyFileSync(source, target);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
16
|
|
|
41
17
|
/**
|
|
42
18
|
* Copy .claude directory from node_modules to project root
|
|
@@ -65,8 +41,8 @@ function copyClaudeDirectory() {
|
|
|
65
41
|
process.exit(1);
|
|
66
42
|
}
|
|
67
43
|
|
|
68
|
-
//
|
|
69
|
-
|
|
44
|
+
// Copy entire directory, overwriting existing files
|
|
45
|
+
cpSync(sourceDir, targetDir, { recursive: true, force: true });
|
|
70
46
|
|
|
71
47
|
console.log('✅ Successfully installed .claude directory');
|
|
72
48
|
console.log('📁 Location:', targetDir);
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -2,41 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Post-installation script for claude-flow-novice
|
|
5
|
-
* Copies .claude directory from
|
|
6
|
-
*
|
|
5
|
+
* Copies .claude directory from package to project root
|
|
6
|
+
* Overwrites existing files to ensure updates work correctly
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { existsSync,
|
|
10
|
-
import { dirname, join
|
|
9
|
+
import { existsSync, cpSync } from 'fs';
|
|
10
|
+
import { dirname, join } from 'path';
|
|
11
11
|
import { fileURLToPath } from 'url';
|
|
12
12
|
|
|
13
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
14
14
|
const __dirname = dirname(__filename);
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
* Simple recursive copy - overwrites existing files
|
|
18
|
-
*/
|
|
19
|
-
function simpleCopy(source, target) {
|
|
20
|
-
if (!existsSync(source)) return;
|
|
21
|
-
|
|
22
|
-
const stat = statSync(source);
|
|
23
|
-
|
|
24
|
-
if (stat.isDirectory()) {
|
|
25
|
-
// Create directory if it doesn't exist
|
|
26
|
-
if (!existsSync(target)) {
|
|
27
|
-
mkdirSync(target, { recursive: true });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Copy contents
|
|
31
|
-
const entries = readdirSync(source);
|
|
32
|
-
for (const entry of entries) {
|
|
33
|
-
simpleCopy(join(source, entry), join(target, entry));
|
|
34
|
-
}
|
|
35
|
-
} else {
|
|
36
|
-
// File - always overwrite
|
|
37
|
-
copyFileSync(source, target);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
16
|
|
|
41
17
|
/**
|
|
42
18
|
* Copy .claude directory from node_modules to project root
|
|
@@ -65,8 +41,8 @@ function copyClaudeDirectory() {
|
|
|
65
41
|
process.exit(1);
|
|
66
42
|
}
|
|
67
43
|
|
|
68
|
-
//
|
|
69
|
-
|
|
44
|
+
// Copy entire directory, overwriting existing files
|
|
45
|
+
cpSync(sourceDir, targetDir, { recursive: true, force: true });
|
|
70
46
|
|
|
71
47
|
console.log('✅ Successfully installed .claude directory');
|
|
72
48
|
console.log('📁 Location:', targetDir);
|