instabox 0.8.179 → 0.8.181
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/instabox.mjs +14 -8
- package/cli/SHA256SUMS +6 -6
- package/cli/instabox-darwin-amd64 +0 -0
- package/cli/instabox-darwin-arm64 +0 -0
- package/cli/instabox-linux-amd64 +0 -0
- package/cli/instabox-linux-arm64 +0 -0
- package/cli/instabox-windows-amd64.exe +0 -0
- package/cli/instabox-windows-arm64.exe +0 -0
- package/package.json +1 -1
package/bin/instabox.mjs
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
cliVersion,
|
|
24
24
|
findCli,
|
|
25
25
|
installBundled,
|
|
26
|
+
installDir,
|
|
26
27
|
isOnboarding,
|
|
27
28
|
missingBundledCli,
|
|
28
29
|
real,
|
|
@@ -269,24 +270,29 @@ async function ensureCli() {
|
|
|
269
270
|
async function ensureBundledCli(bundled, found) {
|
|
270
271
|
const want = await sha256File(bundled).catch(() => null);
|
|
271
272
|
if (found) {
|
|
272
|
-
const
|
|
273
|
+
const target = real(found);
|
|
274
|
+
// A manager can dispatch by argv[0]: probe the file we would replace, not its instabox alias.
|
|
275
|
+
const [version, have] = await Promise.all([cliVersion(target), sha256File(target).catch(() => null)]);
|
|
273
276
|
const v = version ? ` ${version}` : '';
|
|
274
277
|
if (want && have === want) return { line: `instabox CLI${v} is up to date`, tryLs: true };
|
|
278
|
+
if (!version) {
|
|
279
|
+
const destination = join(installDir(), process.platform === 'win32' ? 'instabox.exe' : 'instabox');
|
|
280
|
+
if (real(destination) === target)
|
|
281
|
+
return `${target} is not recognized as an instabox binary, left as is; set INSTABOX_INSTALL_DIR to a different directory or run: npx instabox@latest <command>`;
|
|
282
|
+
return ensureBundledCli(bundled, existsSync(destination) ? destination : null);
|
|
283
|
+
}
|
|
275
284
|
if (version === 'dev' || version?.endsWith('-dirty'))
|
|
276
285
|
return `instabox CLI at ${found} is a development build (${version}), left as is`;
|
|
277
|
-
//
|
|
278
|
-
|
|
279
|
-
const dir = dirname(real(found));
|
|
286
|
+
// Only a target that identifies itself as InstaBox can be upgraded through a symlink.
|
|
287
|
+
const dir = dirname(target);
|
|
280
288
|
try {
|
|
281
289
|
accessSync(dir, fsConstants.W_OK);
|
|
282
290
|
} catch {
|
|
283
291
|
const copy =
|
|
284
|
-
process.platform === 'win32'
|
|
285
|
-
? `copy "${bundled}" "${found}"`
|
|
286
|
-
: `sudo install -m 0755 "${bundled}" "${real(found)}"`;
|
|
292
|
+
process.platform === 'win32' ? `copy "${bundled}" "${found}"` : `sudo install -m 0755 "${bundled}" "${target}"`;
|
|
287
293
|
return `instabox CLI${v} at ${found} is not this package's build and ${dir} is not writable ${dim('· to replace it:')} ${copy}`;
|
|
288
294
|
}
|
|
289
|
-
const r = await installBundled(bundled, { path:
|
|
295
|
+
const r = await installBundled(bundled, { path: target });
|
|
290
296
|
if (r.error) return `instabox CLI${v} at ${found} could not be updated ${dim(`(${r.error})`)}`;
|
|
291
297
|
return { line: `instabox CLI updated${v ? ` from${v}` : ''} to ${r.version} at ${found}`, tryLs: true };
|
|
292
298
|
}
|
package/cli/SHA256SUMS
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
9f2f33dbb600938090c523faff918ed6d45b74f0beff56c4738a7757d5cd744c instabox-darwin-amd64
|
|
2
|
+
ab2033af4d3029c32008b596b41ba788d38e1290133c771e15f5019a10f7204f instabox-darwin-arm64
|
|
3
|
+
a1efe806c154ef1d793637c2707511d40e2a1e98275c1fec0f9845a4253b49eb instabox-linux-amd64
|
|
4
|
+
4629e12280504fdeaf8519539dbd35bf75b9ee528ce615520ea11fef2197df29 instabox-linux-arm64
|
|
5
|
+
be336e332b2c6d8b415801e98e5fc15549d7298d494c1eb470121fcdf7429f94 instabox-windows-amd64.exe
|
|
6
|
+
6adea6b4ec93022f8f40c56ddd0d45661b81ea133d2910b9262e6639c39d016e instabox-windows-arm64.exe
|
|
Binary file
|
|
Binary file
|
package/cli/instabox-linux-amd64
CHANGED
|
Binary file
|
package/cli/instabox-linux-arm64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|