From cdc65d6605911e1c29c1978b1902cb05afdc8c14 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 12:57:02 +1300 Subject: [PATCH] api: use bash to call run/compile script --- api/src/executor/job.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index b10e3ab..12946ab 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -72,10 +72,9 @@ class Job { if(this.state != job_states.PRIMED) throw new Error('Job must be in primed state, current state: ' + this.state.toString()); logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`); logger.debug('Compiling'); - const compile = this.runtime.compiled && await new Promise((resolve, reject) => { var stderr, stdout = ''; - const proc = cp.spawn(path.join(this.runtime.pkgdir, 'compile'), [this.main, ...this.args] ,{ + const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, 'compile'),this.main, ...this.args] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir, @@ -103,7 +102,7 @@ class Job { const run = await new Promise((resolve, reject) => { var stderr, stdout = ''; - const proc = cp.spawn(path.join(this.runtime.pkgdir, 'run'), [this.main, ...this.args] ,{ + const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, 'run'),this.main, ...this.args] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir,