mirror of
https://github.com/MeiK2333/river.git
synced 2025-11-04 14:49:40 +08:00
Update
This commit is contained in:
parent
0dddf01498
commit
e784ac4843
@ -15,9 +15,7 @@ ENV LANG C.UTF-8
|
||||
RUN apt update -y
|
||||
|
||||
# install gcc g++
|
||||
RUN apt install -y \
|
||||
g++ \
|
||||
gcc
|
||||
RUN apt install -y gcc g++
|
||||
|
||||
# install python3.8
|
||||
RUN apt install -y software-properties-common && \
|
||||
|
||||
16
plugins/js/package.json
Normal file
16
plugins/js/package.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "js",
|
||||
"version": "1.0.0",
|
||||
"description": "```bash cd plugins/js ./validate.js success.js ./validate.js failure.js ```",
|
||||
"main": "failure.js",
|
||||
"dependencies": {
|
||||
"esprima": "^4.0.1"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
#!/usr/local/bin/node
|
||||
#!/usr/bin/node
|
||||
const fs = require('fs');
|
||||
const esprima = require('esprima');
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ pub async fn judger(
|
||||
let cmd = match Language::from_i32(request.language) {
|
||||
Some(Language::C) => "./a.out",
|
||||
Some(Language::Cpp) => "./a.out",
|
||||
Some(Language::Python) => "/usr/bin/python3 main.py",
|
||||
Some(Language::Python) => "/usr/bin/python3.8 main.py",
|
||||
Some(Language::Rust) => "./a.out",
|
||||
Some(Language::Node) => "node main.js",
|
||||
Some(Language::TypeScript) => "node main.js",
|
||||
@ -119,9 +119,9 @@ pub async fn compile(
|
||||
let cmd = match Language::from_i32(request.language) {
|
||||
Some(Language::C) => "/usr/bin/gcc main.c -o a.out -Wall -O2 -std=c99 --static",
|
||||
Some(Language::Cpp) => "/usr/bin/g++ main.cpp -O2 -Wall --static -o a.out --std=gnu++17",
|
||||
Some(Language::Python) => "/usr/bin/python3 -m compileall main.py",
|
||||
Some(Language::Rust) => "/usr/bin/rustc main.rs -o a.out -C opt-level=2",
|
||||
Some(Language::Node) => "validate.js main.js",
|
||||
Some(Language::Python) => "/usr/bin/python3.8 -m compileall main.py",
|
||||
Some(Language::Rust) => "/root/.cargo/bin/rustc main.rs -o a.out -C opt-level=2",
|
||||
Some(Language::Node) => "/usr/bin/node /plugins/js/validate.js main.js",
|
||||
Some(Language::TypeScript) => "/usr/bin/tsc main.ts",
|
||||
Some(Language::Go) => "/usr/bin/go build -ldflags \"-s -w\" main.go",
|
||||
None => return Err(Error::LanguageNotFound(request.language)),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user