@ornncompute/cli 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.
@@ -1,5 +1,7 @@
1
1
  import { spawn } from "node:child_process";
2
2
 
3
+ import { configuredAuthBaseUrl } from "./auth-store.mjs";
4
+
3
5
  const DEFAULT_AUTH_BASE_URL = "http://localhost:3000";
4
6
  const DEFAULT_POLL_INTERVAL_SECONDS = 2;
5
7
  const DEFAULT_TIMEOUT_SECONDS = 600;
@@ -14,9 +16,11 @@ export class DeviceAuthError extends Error {
14
16
  }
15
17
 
16
18
  export function resolveAuthBaseUrl({ explicit, env = process.env } = {}) {
19
+ // BETTER_AUTH_URL is generic, any local project may export it for reasons unrelated to Ornn.
17
20
  const value =
18
21
  explicit?.trim() ||
19
22
  env.ORNN_AUTH_BASE_URL?.trim() ||
23
+ configuredAuthBaseUrl(env) ||
20
24
  env.BETTER_AUTH_URL?.trim() ||
21
25
  DEFAULT_AUTH_BASE_URL;
22
26
 
package/src/update.mjs CHANGED
@@ -116,11 +116,7 @@ export function detectInstallContext(binPath, env = process.env) {
116
116
  }
117
117
 
118
118
  function isProjectInstall(resolvedPath, lower) {
119
- // Global npm layouts: <prefix>/lib/node_modules (POSIX) or <prefix>/npm/node_modules (Windows default).
120
- if (lower.includes("/lib/node_modules/") || lower.includes("/npm/node_modules/")) {
121
- return false;
122
- }
123
- // Other global layouts (nvm-windows, Scoop) have no package.json above node_modules; projects do.
119
+ // Global layouts have no package.json above node_modules; projects do.
124
120
  const index = lower.indexOf("/node_modules/");
125
121
  if (index < 0) {
126
122
  return false;