offwatch 0.5.4 → 0.5.6

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/bin/offwatch.js CHANGED
@@ -1,10 +1,17 @@
1
1
  #!/usr/bin/env node
2
- import { loadCLIBinPath } from "./lib/downloader.js";
3
- import { execSync } from "child_process";
2
+ import { loadCLIBinPath } from "../lib/downloader.js";
3
+ import { execSync, spawn } from "child_process";
4
4
  import { dirname } from "path";
5
5
  import { fileURLToPath } from "url";
6
6
 
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
8
 
9
9
  const binPath = await loadCLIBinPath(__dirname);
10
- execSync(binPath, { stdio: "inherit" });
10
+
11
+ // On Windows, run with node. On Unix, run directly
12
+ const isWindows = process.platform === "win32";
13
+ if (isWindows) {
14
+ spawn("node", [binPath], { stdio: "inherit" });
15
+ } else {
16
+ execSync(binPath, { stdio: "inherit" });
17
+ }
package/lib/downloader.js CHANGED
@@ -71,10 +71,11 @@ const downloadRelease = async (versionDir) => {
71
71
  const filePath = path.join(versionDir, CLI_FILENAME);
72
72
  logDebug(`download(${asset.browser_download_url})`);
73
73
 
74
- // For .js files, just download directly
74
+ // For .js files, download to temp then rename
75
75
  if (asset.name.endsWith(".js")) {
76
- await pipeline(got.stream(asset.browser_download_url), fs.createWriteStream(filePath));
77
- fs.chmodSync(filePath, 0o755);
76
+ const tempPath = path.join(versionDir, asset.name);
77
+ await pipeline(got.stream(asset.browser_download_url), fs.createWriteStream(tempPath));
78
+ fs.renameSync(tempPath, filePath);
78
79
  } else {
79
80
  // For compressed files
80
81
  const tarPath = path.join(versionDir, path.basename(asset.browser_download_url));
@@ -89,7 +90,6 @@ const decompress = async (tarPath, outPath) => {
89
90
  C: path.dirname(outPath),
90
91
  strip: 1,
91
92
  }));
92
- fs.chmodSync(outPath, 0o755);
93
93
  };
94
94
 
95
95
  export const loadCLIBinPath = async (cwd) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "offwatch",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "Offwatch — orchestrate AI agent teams to automate dev work",
5
5
  "type": "module",
6
6
  "bin": {