instabox 0.8.179 → 0.8.180
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
|
+
cd463e89b27537f380989744c2a65e63f4f4a10742be6818fb788de81e77af52 instabox-darwin-amd64
|
|
2
|
+
2b0f77378032472baaad53cde8a995fc4a099bef8f5d9825c45eb24ba018fff7 instabox-darwin-arm64
|
|
3
|
+
0ee5423deb803620c6c655c5aea3256c650bd04ada44b7172eceea0ec7d5b6dd instabox-linux-amd64
|
|
4
|
+
c562886042bfed50f9b78cbcbe1ea0f7cdc5e9b8ee4adc77067115f49299aaa8 instabox-linux-arm64
|
|
5
|
+
712f63ed546cb20bb7ae33de30b59fcd3a66ac7cf953b1cbbb536748dc463db1 instabox-windows-amd64.exe
|
|
6
|
+
7008bbc153c4bdf858a49efadd581ad08f2e6af935a176e2145ea5590e10ccc0 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
|