palmier 0.3.7 → 0.3.8
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/platform/linux.js +9 -3
- package/package.json +1 -1
- package/src/platform/linux.ts +8 -3
package/dist/platform/linux.js
CHANGED
|
@@ -96,12 +96,18 @@ WantedBy=default.target
|
|
|
96
96
|
console.log("\nHost initialization complete!");
|
|
97
97
|
}
|
|
98
98
|
async restartDaemon() {
|
|
99
|
-
// Update the service file's PATH
|
|
100
|
-
//
|
|
99
|
+
// Update the service file's PATH so the daemon can find agent CLIs.
|
|
100
|
+
// Resolve the user's login PATH (not the daemon's limited PATH)
|
|
101
|
+
// by sourcing their shell profile.
|
|
101
102
|
const servicePath = path.join(UNIT_DIR, "palmier.service");
|
|
102
103
|
if (fs.existsSync(servicePath)) {
|
|
104
|
+
let userPath = process.env.PATH || "";
|
|
105
|
+
try {
|
|
106
|
+
userPath = execSync("bash -lc 'echo $PATH'", { encoding: "utf-8" }).trim();
|
|
107
|
+
}
|
|
108
|
+
catch { /* fall back to current PATH */ }
|
|
103
109
|
const content = fs.readFileSync(servicePath, "utf-8");
|
|
104
|
-
const updated = content.replace(/^Environment=PATH=.*/m, `Environment=PATH=${
|
|
110
|
+
const updated = content.replace(/^Environment=PATH=.*/m, `Environment=PATH=${userPath || "/usr/local/bin:/usr/bin:/bin"}`);
|
|
105
111
|
if (updated !== content) {
|
|
106
112
|
fs.writeFileSync(servicePath, updated, "utf-8");
|
|
107
113
|
execSync("systemctl --user daemon-reload", { encoding: "utf-8" });
|
package/package.json
CHANGED
package/src/platform/linux.ts
CHANGED
|
@@ -113,14 +113,19 @@ WantedBy=default.target
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
async restartDaemon(): Promise<void> {
|
|
116
|
-
// Update the service file's PATH
|
|
117
|
-
//
|
|
116
|
+
// Update the service file's PATH so the daemon can find agent CLIs.
|
|
117
|
+
// Resolve the user's login PATH (not the daemon's limited PATH)
|
|
118
|
+
// by sourcing their shell profile.
|
|
118
119
|
const servicePath = path.join(UNIT_DIR, "palmier.service");
|
|
119
120
|
if (fs.existsSync(servicePath)) {
|
|
121
|
+
let userPath = process.env.PATH || "";
|
|
122
|
+
try {
|
|
123
|
+
userPath = execSync("bash -lc 'echo $PATH'", { encoding: "utf-8" }).trim();
|
|
124
|
+
} catch { /* fall back to current PATH */ }
|
|
120
125
|
const content = fs.readFileSync(servicePath, "utf-8");
|
|
121
126
|
const updated = content.replace(
|
|
122
127
|
/^Environment=PATH=.*/m,
|
|
123
|
-
`Environment=PATH=${
|
|
128
|
+
`Environment=PATH=${userPath || "/usr/local/bin:/usr/bin:/bin"}`,
|
|
124
129
|
);
|
|
125
130
|
if (updated !== content) {
|
|
126
131
|
fs.writeFileSync(servicePath, updated, "utf-8");
|