clawdock 0.3.0 → 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.
- package/dist/index.js +40 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -405,6 +405,46 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
|
|
|
405
405
|
console.error(" Run without --no-pull to download first.");
|
|
406
406
|
process.exit(1);
|
|
407
407
|
}
|
|
408
|
+
const postInstallScript = path.join(workspaceDir, "scripts", "post-install.sh");
|
|
409
|
+
const postInstallScriptWin = path.join(workspaceDir, "scripts", "post-install.bat");
|
|
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
|
+
}
|
|
427
|
+
if (scriptToRun) {
|
|
428
|
+
console.log(`\u{1F4E6} Running post-install script...`);
|
|
429
|
+
try {
|
|
430
|
+
execSync(scriptCmd, {
|
|
431
|
+
stdio: "inherit",
|
|
432
|
+
cwd: workspaceDir,
|
|
433
|
+
env: {
|
|
434
|
+
...process.env,
|
|
435
|
+
CLAWDOCK_WORKSPACE: workspaceDir,
|
|
436
|
+
CLAWDOCK_AGENT: agentName,
|
|
437
|
+
CLAWDOCK_OWNER: owner,
|
|
438
|
+
CLAWDOCK_SLUG: slug
|
|
439
|
+
},
|
|
440
|
+
shell: isWindows ? "cmd.exe" : void 0
|
|
441
|
+
});
|
|
442
|
+
console.log(` \u2705 Post-install complete`);
|
|
443
|
+
} catch (err) {
|
|
444
|
+
console.warn(` \u26A0\uFE0F Post-install script failed: ${err.message}`);
|
|
445
|
+
console.warn(` Continuing anyway...`);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
408
448
|
const resolvedModel = model || (provider ? `${provider}/claude-sonnet-4` : null);
|
|
409
449
|
console.log(`
|
|
410
450
|
\u{1F980} Starting ${owner}/${slug}...`);
|