api: fix compile stage
runtime.compiled always returned false as it was undefined. This made the code think it's a run-only language, and never called the compile script.
This commit is contained in:
parent
7d3777aef8
commit
870a4c1282
|
@ -131,10 +131,12 @@ class Job {
|
||||||
if(this.state != job_states.PRIMED) throw new Error('Job must be in primed state, current state: ' + this.state.toString());
|
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.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`);
|
||||||
logger.debug('Compiling');
|
logger.debug('Compiling');
|
||||||
const compile = this.runtime.compiled && await this.safe_call(
|
var compile = undefined;
|
||||||
path.join(this.runtime.pkgdir, 'compile'),
|
if(this.runtime.compiled)
|
||||||
[this.main, ...this.files],
|
compile = await this.safe_call(
|
||||||
this.timeouts.compile);
|
path.join(this.runtime.pkgdir, 'compile'),
|
||||||
|
this.files.map(x=>x.name),
|
||||||
|
this.timeouts.compile);
|
||||||
|
|
||||||
logger.debug('Running');
|
logger.debug('Running');
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Runtime {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
get compile(){
|
get compiled(){
|
||||||
if(this.#compiled === undefined) this.#compiled = fss.exists_sync(path.join(this.pkgdir, 'compile'));
|
if(this.#compiled === undefined) this.#compiled = fss.exists_sync(path.join(this.pkgdir, 'compile'));
|
||||||
return this.#compiled;
|
return this.#compiled;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue