offwatch 0.5.7 → 0.5.8
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 +3 -3
- package/lib/downloader.js +2 -2
- package/package.json +1 -1
package/bin/offwatch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { loadCLIBinPath } from "../lib/downloader.js";
|
|
3
|
-
import {
|
|
3
|
+
import { spawn } from "child_process";
|
|
4
4
|
import { dirname } from "path";
|
|
5
5
|
import { fileURLToPath } from "url";
|
|
6
6
|
|
|
@@ -8,5 +8,5 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
8
8
|
|
|
9
9
|
const binPath = await loadCLIBinPath(__dirname);
|
|
10
10
|
|
|
11
|
-
// Run
|
|
12
|
-
spawn("node", [
|
|
11
|
+
// Run the downloaded CLI with node
|
|
12
|
+
spawn("node", [binPath], { stdio: "inherit" });
|
package/lib/downloader.js
CHANGED
|
@@ -68,7 +68,7 @@ const downloadRelease = async (versionDir) => {
|
|
|
68
68
|
fsa.mkdirpSync(versionDir);
|
|
69
69
|
} catch (e) { }
|
|
70
70
|
|
|
71
|
-
const filePath = path.join(versionDir, CLI_FILENAME);
|
|
71
|
+
const filePath = path.join(versionDir, CLI_FILENAME + ".mjs");
|
|
72
72
|
logDebug(`download(${asset.browser_download_url})`);
|
|
73
73
|
|
|
74
74
|
// For .js files, download to temp then rename
|
|
@@ -94,7 +94,7 @@ const decompress = async (tarPath, outPath) => {
|
|
|
94
94
|
|
|
95
95
|
export const loadCLIBinPath = async (cwd) => {
|
|
96
96
|
const versionDir = path.join(cwd, pkg.version);
|
|
97
|
-
const binPath = path.join(versionDir, CLI_FILENAME);
|
|
97
|
+
const binPath = path.join(versionDir, CLI_FILENAME + ".mjs");
|
|
98
98
|
logDebug(`loadCLIBinPath: ${binPath}`);
|
|
99
99
|
|
|
100
100
|
if (!fs.existsSync(binPath)) {
|