Compare commits

..

No commits in common. "d8b430654bc5da463d178311345d08c870a7b9e4" and "b0d8de7fc383715c2c4fda803033b8bcf495683a" have entirely different histories.

9 changed files with 12 additions and 43 deletions

View File

@ -87,6 +87,15 @@ 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
@ -97,15 +106,6 @@ function get_job(body) {
});
}
if (
rt.language !== 'file' &&
!files.some(file => !file.encoding || file.encoding === 'utf8')
) {
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}`;

View File

@ -222,9 +222,7 @@ class Job {
} runtime=${this.runtime.toString()}`
);
const code_files =
(this.runtime.language === 'file' && this.files) ||
this.files.filter(file => file.encoding == 'utf8');
const code_files = this.files.filter(file => file.encoding == 'utf8');
logger.debug('Compiling');
@ -272,9 +270,7 @@ class Job {
} gid=${this.gid} runtime=${this.runtime.toString()}`
);
const code_files =
(this.runtime.language === 'file' && this.files) ||
this.files.filter(file => file.encoding == 'utf8');
const code_files = this.files.filter(file => file.encoding == 'utf8');
if (this.runtime.compiled) {
eventBus.emit('stage', 'compile');

View File

@ -245,18 +245,9 @@ async function run_non_interactively(files, argv) {
exports.handler = async argv => {
const files = [...(argv.files || []), argv.file].map(file_path => {
const buffer = fs.readFileSync(file_path);
const encoding =
(buffer
.toString()
.split('')
.some(x => x.charCodeAt(0) >= 128) &&
'base64') ||
'utf8';
return {
name: path.basename(file_path),
content: buffer.toString(encoding),
encoding,
content: fs.readFileSync(file_path).toString(),
};
});

View File

@ -1,3 +0,0 @@
#!/bin/bash
# Nothing to do here

View File

@ -1,3 +0,0 @@
#!/bin/bash
export PATH=$PWD:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "file",
"version": "0.0.1",
"aliases": ["executable", "elf", "binary"]
}

View File

@ -1,6 +0,0 @@
#!/bin/bash
filename="$1"
chmod +x "$filename"
shift
./"$filename" "$@"

Binary file not shown.

View File

@ -341,7 +341,6 @@ Content-Type: application/json
`elixir`,
`emacs`,
`erlang`,
`file`,
`forte`,
`fortran`,
`freebasic`,