@boxes-dev/dvb 1.0.579 → 1.0.580

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/bin/dvb.cjs CHANGED
@@ -3051,6 +3051,8 @@ var VALIDATION_TIMEOUT_MS = 5e3;
3051
3051
  var UPGRADE_REQUIRED_EXIT_CODE = 86;
3052
3052
  var UPDATER_INTERVAL_MS = 15 * 60 * 1e3;
3053
3053
  var MAX_UPDATER_ERROR_LENGTH = 2e3;
3054
+ var DEVBOX_INSTALL_OWNER_PATHS_ENV = "DEVBOX_INSTALL_OWNER_PATHS";
3055
+ var DEVBOX_UPGRADE_HELPER_PATH_ENV = "DEVBOX_UPGRADE_HELPER_PATH";
3054
3056
  var runtimeManagerTestHooks = {
3055
3057
  ensureBundledRuntimeStaged: void 0,
3056
3058
  listLiveRuntimeVersions: void 0,
@@ -3073,6 +3075,28 @@ var resolveBasePath = () => {
3073
3075
  const argv1 = typeof process.argv[1] === "string" ? process.argv[1] : "";
3074
3076
  return argv1 || import_node_path11.default.join(process.cwd(), "dvb");
3075
3077
  };
3078
+ var readInstallOwnerPaths = (env = process.env) => {
3079
+ const raw = env[DEVBOX_INSTALL_OWNER_PATHS_ENV]?.trim();
3080
+ if (!raw) {
3081
+ return [];
3082
+ }
3083
+ return [
3084
+ ...new Set(raw.split(import_node_path11.default.delimiter).map((value) => value.trim()))
3085
+ ].filter((value) => value.length > 0);
3086
+ };
3087
+ var withBootstrapInstallOwnerEnv = (env = process.env) => {
3088
+ if (readInstallOwnerPaths(env).length > 0) {
3089
+ return env;
3090
+ }
3091
+ const ownerPath = resolveBasePath().trim();
3092
+ if (!ownerPath) {
3093
+ return env;
3094
+ }
3095
+ return {
3096
+ ...env,
3097
+ [DEVBOX_INSTALL_OWNER_PATHS_ENV]: ownerPath
3098
+ };
3099
+ };
3076
3100
  var readJsonFile = async (filePath) => {
3077
3101
  const raw = await import_promises2.default.readFile(filePath, "utf8");
3078
3102
  return JSON.parse(raw);
@@ -3611,10 +3635,12 @@ var ensureBundledRuntimeStaged = async (homeDir = import_node_os2.default.homedi
3611
3635
  }
3612
3636
  };
3613
3637
  var runRuntimeChild = async (binPath, args, signalPath) => {
3638
+ const upgradeHelperPath = resolveBootstrapBinPath("dvb-update");
3614
3639
  const child = (0, import_node_child_process.spawn)(process.execPath, [binPath, ...args], {
3615
3640
  env: {
3616
- ...process.env,
3617
- DEVBOX_UPGRADE_REQUIRED_SIGNAL_PATH: signalPath
3641
+ ...withBootstrapInstallOwnerEnv(process.env),
3642
+ DEVBOX_UPGRADE_REQUIRED_SIGNAL_PATH: signalPath,
3643
+ [DEVBOX_UPGRADE_HELPER_PATH_ENV]: upgradeHelperPath
3618
3644
  },
3619
3645
  stdio: "inherit"
3620
3646
  });
@@ -3709,7 +3735,7 @@ var startBackgroundUpdater = async (homeDir = import_node_os2.default.homedir())
3709
3735
  }
3710
3736
  const updaterBinPath = resolveBootstrapBinPath("dvb-update");
3711
3737
  const child = (0, import_node_child_process.spawn)(process.execPath, [updaterBinPath, "--daemon"], {
3712
- env: process.env,
3738
+ env: withBootstrapInstallOwnerEnv(process.env),
3713
3739
  stdio: "ignore",
3714
3740
  detached: true
3715
3741
  });