pkg(file-0.0.1): Run executable
This commit is contained in:
parent
85cba0d89d
commit
64833a0408
|
@ -87,15 +87,6 @@ function get_job(body) {
|
|||
}
|
||||
}
|
||||
|
||||
if (
|
||||
files.filter(file => !file.encoding || file.encoding === 'utf8')
|
||||
.length === 0
|
||||
) {
|
||||
return reject({
|
||||
message: 'files must include at least one utf8 encoded file',
|
||||
});
|
||||
}
|
||||
|
||||
const rt = runtime.get_latest_runtime_matching_language_version(
|
||||
language,
|
||||
version
|
||||
|
@ -106,6 +97,16 @@ function get_job(body) {
|
|||
});
|
||||
}
|
||||
|
||||
if (
|
||||
rt.language !== 'file' &&
|
||||
files.filter(file => !file.encoding || file.encoding === 'utf8')
|
||||
.length === 0
|
||||
) {
|
||||
return reject({
|
||||
message: 'files must include at least one utf8 encoded file',
|
||||
});
|
||||
}
|
||||
|
||||
for (const constraint of ['memory_limit', 'timeout']) {
|
||||
for (const type of ['compile', 'run']) {
|
||||
const constraint_name = `${type}_${constraint}`;
|
||||
|
|
|
@ -222,7 +222,9 @@ class Job {
|
|||
} runtime=${this.runtime.toString()}`
|
||||
);
|
||||
|
||||
const code_files = this.files.filter(file => file.encoding == 'utf8');
|
||||
const code_files =
|
||||
(this.runtime.language === 'file' && this.files) ||
|
||||
this.files.filter(file => file.encoding == 'utf8');
|
||||
|
||||
logger.debug('Compiling');
|
||||
|
||||
|
@ -270,7 +272,9 @@ class Job {
|
|||
} gid=${this.gid} runtime=${this.runtime.toString()}`
|
||||
);
|
||||
|
||||
const code_files = this.files.filter(file => file.encoding == 'utf8');
|
||||
const code_files =
|
||||
(this.runtime.language === 'file' && this.files) ||
|
||||
this.files.filter(file => file.encoding == 'utf8');
|
||||
|
||||
if (this.runtime.compiled) {
|
||||
eventBus.emit('stage', 'compile');
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Nothing to do here
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
export PATH=$PWD:$PATH
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"language": "file",
|
||||
"version": "0.0.1",
|
||||
"aliases": ["executable", "elf", "binary"]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
filename="$1"
|
||||
chmod +x "$filename"
|
||||
shift
|
||||
./"$filename" "$@"
|
Binary file not shown.
Loading…
Reference in New Issue