@rubytech/taskmaster 1.0.55 → 1.0.57
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/dist/build-info.json +2 -2
- package/dist/infra/update-runner.js +9 -11
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -4,7 +4,7 @@ import path from "node:path";
|
|
|
4
4
|
import { runCommandWithTimeout } from "../process/exec.js";
|
|
5
5
|
import { compareSemverStrings } from "./update-check.js";
|
|
6
6
|
import { DEV_BRANCH, isBetaTag, isStableTag } from "./update-channels.js";
|
|
7
|
-
import { detectGlobalInstallManagerForRoot, globalInstallArgs
|
|
7
|
+
import { detectGlobalInstallManagerForRoot, globalInstallArgs } from "./update-global.js";
|
|
8
8
|
import { trimLogTail } from "./restart-sentinel.js";
|
|
9
9
|
const DEFAULT_TIMEOUT_MS = 20 * 60_000;
|
|
10
10
|
const MAX_LOG_CHARS = 8000;
|
|
@@ -439,17 +439,15 @@ export async function runGatewayUpdate(opts = {}) {
|
|
|
439
439
|
const beforeVersion = await readPackageVersion(pkgRoot);
|
|
440
440
|
const globalManager = await detectGlobalInstallManagerForRoot(runCommand, pkgRoot, timeoutMs);
|
|
441
441
|
if (globalManager) {
|
|
442
|
-
//
|
|
442
|
+
// Global npm installs on Linux/macOS typically need sudo unless running as root
|
|
443
|
+
// or using a user-prefix setup (nvm, volta, etc.)
|
|
443
444
|
let needsSudo = false;
|
|
444
|
-
if (os.platform() !== "win32") {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
catch {
|
|
451
|
-
needsSudo = true;
|
|
452
|
-
}
|
|
445
|
+
if (os.platform() !== "win32" && process.getuid?.() !== 0) {
|
|
446
|
+
try {
|
|
447
|
+
await fs.access(pkgRoot, fs.constants.W_OK);
|
|
448
|
+
}
|
|
449
|
+
catch {
|
|
450
|
+
needsSudo = true;
|
|
453
451
|
}
|
|
454
452
|
}
|
|
455
453
|
const spec = `@rubytech/taskmaster@${normalizeTag(opts.tag)}`;
|