@term-hub/term-hub 0.1.4 → 0.1.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/lib/resolve.js +2 -2
- package/package.json +10 -8
- package/scripts/postinstall.js +27 -10
package/lib/resolve.js
CHANGED
|
@@ -40,10 +40,10 @@ function exe(name) {
|
|
|
40
40
|
throw new Error(
|
|
41
41
|
windows
|
|
42
42
|
? `Terminal Hub: Windows support is in progress — no prebuilt binary yet.\n` +
|
|
43
|
-
`Track it: https://github.com/
|
|
43
|
+
`Track it: https://github.com/AayushGour/terminal-hub-releases#platform-support`
|
|
44
44
|
: `Terminal Hub: no prebuilt binary for ${KEY}.\n` +
|
|
45
45
|
`Supported: ${[...SUPPORTED].join(", ")}.\n` +
|
|
46
|
-
`See: https://github.com/
|
|
46
|
+
`See: https://github.com/AayushGour/terminal-hub-releases#platform-support`
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
const dir = binDir();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@term-hub/term-hub",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Terminal Hub — capture every terminal you open and manage them all from one window. One-command cross-platform install (macOS / Linux / Windows).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"terminal",
|
|
@@ -11,11 +11,13 @@
|
|
|
11
11
|
"terminal-manager",
|
|
12
12
|
"tauri"
|
|
13
13
|
],
|
|
14
|
-
"homepage": "https://github.com/AayushGour/terminal-hub#readme",
|
|
14
|
+
"homepage": "https://github.com/AayushGour/terminal-hub-releases#readme",
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/AayushGour/terminal-hub.git"
|
|
18
|
-
|
|
17
|
+
"url": "git+https://github.com/AayushGour/terminal-hub-releases.git"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/AayushGour/terminal-hub-releases/issues"
|
|
19
21
|
},
|
|
20
22
|
"license": "MIT",
|
|
21
23
|
"author": "Aayush Gour <ag14906@gmail.com>",
|
|
@@ -39,10 +41,10 @@
|
|
|
39
41
|
},
|
|
40
42
|
"//": "optionalDependencies: npm installs ONLY the package whose os/cpu matches the host, so a mac user downloads just the darwin binaries, etc. Versions are kept in lockstep with this package and bumped together by CI.",
|
|
41
43
|
"optionalDependencies": {
|
|
42
|
-
"@term-hub/darwin-arm64": "0.1.
|
|
43
|
-
"@term-hub/darwin-x64": "0.1.
|
|
44
|
-
"@term-hub/linux-x64": "0.1.
|
|
45
|
-
"@term-hub/linux-arm64": "0.1.
|
|
44
|
+
"@term-hub/darwin-arm64": "0.1.6",
|
|
45
|
+
"@term-hub/darwin-x64": "0.1.6",
|
|
46
|
+
"@term-hub/linux-x64": "0.1.6",
|
|
47
|
+
"@term-hub/linux-arm64": "0.1.6"
|
|
46
48
|
},
|
|
47
49
|
"engines": {
|
|
48
50
|
"node": ">=18"
|
package/scripts/postinstall.js
CHANGED
|
@@ -67,13 +67,24 @@ function safe(fn) {
|
|
|
67
67
|
if (process.platform !== "darwin" && process.platform !== "linux") process.exit(0);
|
|
68
68
|
|
|
69
69
|
let hubBin = null;
|
|
70
|
+
let hubBinErr = null;
|
|
70
71
|
try {
|
|
71
72
|
const p = require("../lib/resolve").exe("hub");
|
|
72
73
|
if (fs.existsSync(p)) hubBin = p;
|
|
73
|
-
}
|
|
74
|
-
|
|
74
|
+
else hubBinErr = `resolved path ${p} does not exist`;
|
|
75
|
+
} catch (e) {
|
|
76
|
+
hubBinErr = e.message || String(e);
|
|
77
|
+
}
|
|
78
|
+
if (!hubBin) {
|
|
79
|
+
// This is the #1 cause of a silent "npm install did nothing" report: the
|
|
80
|
+
// platform-specific optional dependency (e.g. @term-hub/darwin-arm64)
|
|
81
|
+
// isn't installed or is missing its binary, so there's nothing to verify
|
|
82
|
+
// the GUI update signature with, so the whole GUI install step is skipped.
|
|
83
|
+
// Say so instead of exiting quietly -- the CLI itself still works either
|
|
84
|
+
// way, so this is informational, not an install failure.
|
|
85
|
+
if (hubBinErr) console.error(`Terminal Hub: skipping GUI install -- no CLI binary to verify signatures with (${hubBinErr}).`);
|
|
86
|
+
process.exit(0);
|
|
75
87
|
}
|
|
76
|
-
if (!hubBin) process.exit(0);
|
|
77
88
|
|
|
78
89
|
// Tauri's {{target}}/{{arch}} keys, e.g. "darwin-aarch64", "linux-x86_64".
|
|
79
90
|
const TARGET = { darwin: "darwin", linux: "linux" }[process.platform];
|
|
@@ -113,21 +124,27 @@ function installedVersionLinux() {
|
|
|
113
124
|
}
|
|
114
125
|
}
|
|
115
126
|
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
127
|
+
// Checked before the fetch (cheap, local, no network) so a fetch failure
|
|
128
|
+
// can be judged against it below: an already-installed user going offline
|
|
129
|
+
// is a real no-op and must stay silent, but a never-installed machine that
|
|
130
|
+
// can't reach GitHub must not look identical to "nothing to do" -- that's
|
|
131
|
+
// exactly what makes a fresh `npm install -g` look like it silently did
|
|
132
|
+
// nothing.
|
|
133
|
+
const installed = process.platform === "darwin" ? installedVersionMac() : installedVersionLinux();
|
|
134
|
+
|
|
120
135
|
let manifest = null;
|
|
121
136
|
try {
|
|
122
137
|
manifest = fetchJsonSync(LATEST_JSON_URL);
|
|
123
|
-
} catch {
|
|
124
|
-
|
|
138
|
+
} catch (e) {
|
|
139
|
+
if (!installed) {
|
|
140
|
+
console.error(`Terminal Hub: could not check for the GUI app (${e.message || e}). The \`hub\`/\`term-hub\` CLI still works; retry the GUI install later with a fresh \`npm install -g @term-hub/term-hub\`.`);
|
|
141
|
+
}
|
|
142
|
+
process.exit(0); // offline/GitHub-unreachable is a real no-op once already installed
|
|
125
143
|
}
|
|
126
144
|
|
|
127
145
|
const entry = manifest.platforms && manifest.platforms[PLATFORM_KEY];
|
|
128
146
|
if (!entry) process.exit(0); // no release artifact for this platform/arch yet
|
|
129
147
|
|
|
130
|
-
const installed = process.platform === "darwin" ? installedVersionMac() : installedVersionLinux();
|
|
131
148
|
if (installed && versionAtLeast(installed, manifest.version)) {
|
|
132
149
|
process.exit(0); // already current -- install exactly once, never redundantly re-download/re-extract
|
|
133
150
|
}
|