offwatch 0.5.13 → 0.5.15
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 +1 -1
- package/lib/downloader.js +4 -0
- package/package.json +1 -1
- package/postinstall.js +2 -5
package/bin/offwatch.js
CHANGED
|
@@ -9,4 +9,4 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
9
9
|
const binPath = await loadCLIBinPath(__dirname);
|
|
10
10
|
|
|
11
11
|
// Run the downloaded CLI binary
|
|
12
|
-
spawn("node", [binPath], { stdio: "inherit" });
|
|
12
|
+
spawn("node", [binPath, ...process.argv.slice(2)], { stdio: "inherit" });
|
package/lib/downloader.js
CHANGED
|
@@ -90,6 +90,10 @@ const downloadRelease = async (versionDir) => {
|
|
|
90
90
|
}));
|
|
91
91
|
fs.unlinkSync(tempPath);
|
|
92
92
|
}
|
|
93
|
+
|
|
94
|
+
// Copy package.json to bin directory so bundled code can find it
|
|
95
|
+
const binDir = path.join(versionDir, "..");
|
|
96
|
+
fs.copyFileSync(__dirname + "/../package.json", path.join(binDir, "package.json"));
|
|
93
97
|
};
|
|
94
98
|
|
|
95
99
|
export const loadCLIBinPath = async (cwd) => {
|
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -4,11 +4,8 @@ import { fileURLToPath } from "url";
|
|
|
4
4
|
|
|
5
5
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
6
|
|
|
7
|
-
// Skip download in monorepo development
|
|
8
|
-
if (process.cwd().includes("node_modules")) {
|
|
9
|
-
if (process.env.DEBUG) {
|
|
10
|
-
console.debug(`[DEBUG] downloading CLI binary`);
|
|
11
|
-
}
|
|
7
|
+
// Skip download in monorepo development (workspace packages are used directly)
|
|
8
|
+
if (!process.cwd().includes("node_modules")) {
|
|
12
9
|
loadCLIBinPath(__dirname).then(
|
|
13
10
|
() => {
|
|
14
11
|
process.exit(0);
|