From a1a2589b74a8b14efd01c23dbf9076258f1cbe67 Mon Sep 17 00:00:00 2001 From: Jennings Zhang Date: Fri, 20 Dec 2024 16:18:21 -0500 Subject: [PATCH] Add cwd parameter --- githubActions/cleanup.js | 6 +++++- githubActions/main.js | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/githubActions/cleanup.js b/githubActions/cleanup.js index bbf3ed2f..bb2c2c6c 100755 --- a/githubActions/cleanup.js +++ b/githubActions/cleanup.js @@ -1,6 +1,10 @@ const child_process = require('child_process'); +const path = require('path'); child_process.execFileSync( 'just', ['nuke'], - { stdio: 'inherit' } + { + stdio: 'inherit', + cwd: path.resolve(__dirname, '..') + } ); diff --git a/githubActions/main.js b/githubActions/main.js index 337485a1..e4b5690a 100755 --- a/githubActions/main.js +++ b/githubActions/main.js @@ -1,11 +1,11 @@ const child_process = require('child_process'); +const path = require('path'); const CONTAINER_ENGINE = process.env.INPUT_ENGINE; const JUST_COMMAND = process.env.INPUT_COMMAND; const script = ` set -x -cd ${__dirname}/.. just prefer ${CONTAINER_ENGINE} # start-up is being retried as a workaround for @@ -28,5 +28,10 @@ fi exit $rc `; -child_process.execFileSync('bash', ['-c', script], { stdio: 'inherit' }); +child_process.execFileSync('bash', ['-c', script], + { + stdio: 'inherit', + cwd: path.resolve(__dirname, '..') + } +);