@usebitl/cli 0.1.5 → 0.1.7

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.
@@ -467,7 +467,7 @@ function readCloudConfig(home = bitlHome()) {
467
467
  }
468
468
  }
469
469
  function clientVersionHeader() {
470
- const v = "0.1.5";
470
+ const v = "0.1.7";
471
471
  return v ? { "x-bitl-client": v } : {};
472
472
  }
473
473
  function resolveTarget(home = bitlHome()) {
package/bin/bitl.mjs CHANGED
@@ -5,7 +5,7 @@
5
5
  // node bin/bitl.mjs __sync — copy only (npm postinstall). A failure does not block the install
6
6
  import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
7
7
  import { homedir } from 'node:os';
8
- import { join } from 'node:path';
8
+ import { join, sep } from 'node:path';
9
9
  import { fileURLToPath } from 'node:url';
10
10
 
11
11
  const syncOnly = process.argv[2] === '__sync';
@@ -28,6 +28,8 @@ try {
28
28
  if (syncOnly) process.exit(0);
29
29
 
30
30
  process.env.BITL_ADAPTER_DIR = dir;
31
+ // Run via npx (from the npm cache's _npx folder): the update notice suggests npx @usebitl/cli@latest instead of npm i -g
32
+ if (fileURLToPath(import.meta.url).includes(`${sep}_npx${sep}`)) process.env.BITL_INSTALL = 'npx';
31
33
  // Web UI that bitl start serves (built into the package)
32
34
  process.env.BITL_WEB_DIST ??= fileURLToPath(new URL('../web/', import.meta.url));
33
35
  await import('../dist/cli.mjs');