Skip to content

Commit 42e6daa

Browse files
fix: fall back to /bin/echo for non-usr-merged distros
1 parent 05e3151 commit 42e6daa

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎dist/post/index.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32303,7 +32303,9 @@ process.on("unhandledRejection", (reason) => {
3230332303
}))();
3230432304
function handleAgentBravoCleanup() {
3230532305
return cleanup_awaiter(this, void 0, void 0, function* () {
32306-
external_child_process_.execFileSync("/usr/bin/echo", ["step_policy_jobend"]);
32306+
// Non-usr-merged distros (e.g. Debian bullseye) only have /bin/echo.
32307+
const echoBin = external_fs_.existsSync("/usr/bin/echo") ? "/usr/bin/echo" : "/bin/echo";
32308+
external_child_process_.execFileSync(echoBin, ["step_policy_jobend"]);
3230732309
const doneFile = "/home/agent/done.json";
3230832310
let counter = 0;
3230932311
while (true) {

‎dist/post/index.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/cleanup.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ process.on("unhandledRejection", (reason) => {
8686
})();
8787

8888
async function handleAgentBravoCleanup() {
89-
cp.execFileSync("/usr/bin/echo", ["step_policy_jobend"]);
89+
// Non-usr-merged distros (e.g. Debian bullseye) only have /bin/echo.
90+
const echoBin = fs.existsSync("/usr/bin/echo") ? "/usr/bin/echo" : "/bin/echo";
91+
cp.execFileSync(echoBin, ["step_policy_jobend"]);
9092

9193
const doneFile = "/home/agent/done.json";
9294
let counter = 0;

0 commit comments

Comments
 (0)