@questionbase/deskfree 0.5.1 → 0.5.2

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.js CHANGED
@@ -65,7 +65,7 @@ function getMacPaths(name2) {
65
65
  return {
66
66
  deskfreeDir,
67
67
  envFile: join(deskfreeDir, ".env"),
68
- launcher: join(deskfreeDir, "launcher.sh"),
68
+ launcher: join(deskfreeDir, "deskfree.sh"),
69
69
  logDir: join(deskfreeDir, "logs"),
70
70
  plist: join(home, "Library", "LaunchAgents", `${plistLabel}.plist`)
71
71
  };
@@ -120,6 +120,8 @@ function installMac(token, name2) {
120
120
  console.error("Error: node not found in PATH");
121
121
  process.exit(1);
122
122
  }
123
+ const extraPathDirs = (process.env["PATH"] ?? "").split(":").filter((d) => d && d !== nodeBinDir);
124
+ const fullPath = [nodeBinDir, ...extraPathDirs].join(":");
123
125
  mkdirSync(paths.deskfreeDir, { recursive: true });
124
126
  mkdirSync(paths.logDir, { recursive: true });
125
127
  mkdirSync(dirname(paths.plist), { recursive: true });
@@ -135,7 +137,7 @@ DESKFREE_INSTANCE_NAME=${name2}
135
137
  const launcher = `#!/bin/bash
136
138
  set -euo pipefail
137
139
 
138
- export PATH="${nodeBinDir}:$PATH"
140
+ export PATH="${fullPath}"
139
141
 
140
142
  # Update to latest version before starting
141
143
  npm install -g ${PACKAGE} 2>/dev/null || true