clawdock 0.3.1 → 0.3.2

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/dist/index.js +17 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -407,11 +407,26 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
407
407
  }
408
408
  const postInstallScript = path.join(workspaceDir, "scripts", "post-install.sh");
409
409
  const postInstallScriptWin = path.join(workspaceDir, "scripts", "post-install.bat");
410
- const scriptToRun = isWindows ? fs.existsSync(postInstallScriptWin) ? postInstallScriptWin : fs.existsSync(postInstallScript) ? postInstallScript : null : fs.existsSync(postInstallScript) ? postInstallScript : null;
410
+ let scriptToRun = null;
411
+ let scriptCmd;
412
+ if (isWindows && fs.existsSync(postInstallScriptWin)) {
413
+ scriptToRun = postInstallScriptWin;
414
+ scriptCmd = `"${postInstallScriptWin}"`;
415
+ } else if (fs.existsSync(postInstallScript)) {
416
+ scriptToRun = postInstallScript;
417
+ if (isWindows) {
418
+ const shPath = postInstallScript.replace(/\\/g, "/");
419
+ scriptCmd = `bash "${shPath}"`;
420
+ } else {
421
+ scriptCmd = `bash "${postInstallScript}"`;
422
+ }
423
+ } else {
424
+ scriptToRun = null;
425
+ scriptCmd = "";
426
+ }
411
427
  if (scriptToRun) {
412
428
  console.log(`\u{1F4E6} Running post-install script...`);
413
429
  try {
414
- const scriptCmd = isWindows && scriptToRun.endsWith(".bat") ? `"${scriptToRun}"` : `bash "${scriptToRun}"`;
415
430
  execSync(scriptCmd, {
416
431
  stdio: "inherit",
417
432
  cwd: workspaceDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawdock",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "CLI for ClawDock — the agent registry",
5
5
  "bin": {
6
6
  "clawdock": "./dist/index.js"