clawdock 0.2.1 → 0.2.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 +15 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -311,13 +311,20 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
311
311
  const [runtimeName, runtimeVersion] = runtimeSpec.split("@");
312
312
  console.log(`\u{1F50D} Checking runtime: ${runtimeName}...`);
313
313
  let runtimeBin = null;
314
+ const isWindows = process.platform === "win32";
315
+ const whichCmd = isWindows ? "where" : "which";
316
+ const devNull = isWindows ? "2>NUL" : "2>/dev/null";
314
317
  if (runtimeName === "openclaw") {
315
318
  try {
316
- const which = execSync("which openclaw 2>/dev/null", { encoding: "utf-8" }).trim();
317
- if (which) {
318
- runtimeBin = which;
319
- const ver = execSync("openclaw --version 2>/dev/null", { encoding: "utf-8" }).trim();
320
- console.log(` Found openclaw ${ver}`);
319
+ const found = execSync(`${whichCmd} openclaw ${devNull}`, { encoding: "utf-8" }).trim().split("\n")[0];
320
+ if (found) {
321
+ runtimeBin = found;
322
+ try {
323
+ const ver = execSync(`openclaw --version ${devNull}`, { encoding: "utf-8" }).trim();
324
+ console.log(` Found openclaw ${ver}`);
325
+ } catch {
326
+ console.log(` Found openclaw at ${found}`);
327
+ }
321
328
  }
322
329
  } catch {
323
330
  }
@@ -325,7 +332,7 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
325
332
  console.log(" OpenClaw not found. Installing via npm...");
326
333
  try {
327
334
  execSync("npm install -g openclaw", { stdio: "inherit" });
328
- runtimeBin = execSync("which openclaw", { encoding: "utf-8" }).trim();
335
+ runtimeBin = execSync(`${whichCmd} openclaw`, { encoding: "utf-8" }).trim().split("\n")[0];
329
336
  console.log(" \u2705 OpenClaw installed");
330
337
  } catch {
331
338
  console.error("\u274C Failed to install OpenClaw. Install manually:");
@@ -337,11 +344,11 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
337
344
  const candidates = [
338
345
  "nullclaw",
339
346
  path.join(os.homedir(), ".nullclaw", "bin", "nullclaw"),
340
- "/usr/local/bin/nullclaw"
347
+ ...isWindows ? [] : ["/usr/local/bin/nullclaw"]
341
348
  ];
342
349
  for (const c of candidates) {
343
350
  try {
344
- execSync(`which ${c} 2>/dev/null || test -x ${c}`, { stdio: "pipe" });
351
+ execSync(`${whichCmd} ${c} ${devNull}`, { stdio: "pipe" });
345
352
  runtimeBin = c;
346
353
  break;
347
354
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawdock",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "CLI for ClawDock — the agent registry",
5
5
  "bin": {
6
6
  "clawdock": "./dist/index.js"