pi-cicd 1.0.9 → 1.0.10

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/install.mjs +17 -2
  2. package/package.json +1 -1
package/install.mjs CHANGED
@@ -18,10 +18,25 @@ const configPath = path.join(agentDir, `${pkgName}.json`);
18
18
  // Get the directory where this script is located (package root)
19
19
  const pkgRoot = path.dirname(fileURLToPath(import.meta.url));
20
20
 
21
+ // Find project root (go up from node_modules)
22
+ function findProjectRoot(pkgDir) {
23
+ // If we're in node_modules/<pkg>, go up to project root
24
+ const nodeModulesIndex = pkgDir.indexOf("/node_modules/");
25
+ if (nodeModulesIndex !== -1) {
26
+ return pkgDir.substring(0, nodeModulesIndex);
27
+ }
28
+ return pkgDir;
29
+ }
30
+
31
+ const projectRoot = findProjectRoot(pkgRoot);
32
+
21
33
  // Copy skills to project skills/ directory
22
34
  function copySkills() {
23
35
  const skillsSrc = path.join(pkgRoot, "skills");
24
- const skillsDest = path.join(process.cwd(), "skills", pkgName);
36
+ const skillsDest = path.join(projectRoot, "skills", pkgName);
37
+
38
+ console.log(`Copying skills from: ${skillsSrc}`);
39
+ console.log(`Copying skills to: ${skillsDest}`);
25
40
 
26
41
  // Create skills destination directory
27
42
  fs.mkdirSync(skillsDest, { recursive: true });
@@ -70,4 +85,4 @@ if (!fs.existsSync(configPath)) {
70
85
  copySkills();
71
86
 
72
87
  console.log(`\nInstall complete for ${pkgName}`);
73
- console.log(`Skills installed to: ${path.join(process.cwd(), "skills", pkgName)}`);
88
+ console.log(`Skills installed to: ${path.join(projectRoot, "skills", pkgName)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-cicd",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Extension for Pi coding agent",
5
5
  "type": "module",
6
6
  "main": "./index.ts",