@opennous/cli 0.18.1 → 0.18.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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/index.js +2 -5
- package/src/runner.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @opennous/cli changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.2
|
|
4
|
+
|
|
5
|
+
### Fixed: the runner service finds your Mac's name
|
|
6
|
+
|
|
7
|
+
Started at login, the runner couldn't find `scutil`, so it named your Mac by its network hostname
|
|
8
|
+
instead of its own name. It now calls it by its full path, and saves nothing (GET-1308).
|
|
9
|
+
|
|
3
10
|
## 0.18.1
|
|
4
11
|
|
|
5
12
|
### Fixed: one machine is one runner
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -731,13 +731,10 @@ runnerCmd
|
|
|
731
731
|
if (s.log) console.log(`Log: ${s.log}`);
|
|
732
732
|
});
|
|
733
733
|
|
|
734
|
-
/** This machine's name for its runner,
|
|
734
|
+
/** This machine's name for its runner, the same every run (GET-1308). */
|
|
735
735
|
async function runnerHost() {
|
|
736
736
|
const { machineName } = await import("./runner.js");
|
|
737
|
-
|
|
738
|
-
const name = machineName({ saved: cfg.runnerHost ?? null });
|
|
739
|
-
if (name !== cfg.runnerHost) writeConfig({ ...cfg, runnerHost: name });
|
|
740
|
-
return name;
|
|
737
|
+
return machineName();
|
|
741
738
|
}
|
|
742
739
|
|
|
743
740
|
/** The agent to read with: the one asked for, or whichever is signed in. Exits with what to do. */
|
package/src/runner.js
CHANGED
|
@@ -37,12 +37,14 @@ export const RUN_COMMAND = "npx -y @opennous/cli@latest runner";
|
|
|
37
37
|
/**
|
|
38
38
|
* This machine's name for Ownable (GET-1308), the same every run. `os.hostname()` on a Mac follows
|
|
39
39
|
* the network ("Mac.lan" on one, "Bennets-MacBook-Air.local" on another), which made one machine
|
|
40
|
-
* two runners. The Mac's own name (System Settings → General → About) is
|
|
40
|
+
* two runners. The Mac's own name (System Settings → General → About) is the same every run, so it
|
|
41
|
+
* is asked each time; elsewhere the hostname is stable. Nothing is saved: 0.18.1 saved a fallback.
|
|
41
42
|
*/
|
|
42
43
|
export function machineName({ saved = null, os = platform(), run = spawnSync, host = hostname } = {}) {
|
|
43
44
|
if (saved) return saved;
|
|
44
45
|
if (os === "darwin") {
|
|
45
|
-
|
|
46
|
+
// By its full path: a launchd service's PATH has no /usr/sbin (GET-1308, 0.18.2).
|
|
47
|
+
const r = run("/usr/sbin/scutil", ["--get", "ComputerName"], { encoding: "utf8" });
|
|
46
48
|
const name = r.status === 0 ? String(r.stdout).trim() : "";
|
|
47
49
|
if (name) return name;
|
|
48
50
|
}
|