mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-24 05:56:26 +02:00
add support for multiple arguments
This commit is contained in:
parent
60af1efaad
commit
101cf9aeeb
15 changed files with 38 additions and 28 deletions
|
@ -14,6 +14,11 @@ fi
|
|||
lang=$1
|
||||
filepath=$(realpath $2)
|
||||
file=$(basename $2)
|
||||
argpath="/tmp/$(date +%s%N).args"
|
||||
arg=$(basename $argpath)
|
||||
|
||||
# write arg file
|
||||
echo "${@:3}" > $argpath
|
||||
|
||||
bin=
|
||||
case "$lang" in
|
||||
|
@ -64,6 +69,7 @@ docker run \
|
|||
--rm \
|
||||
--log-driver none \
|
||||
-v $filepath:/$file:ro \
|
||||
-v $argpath:/$arg:ro \
|
||||
-v $dir/executors/python2:/executor_python2:ro \
|
||||
-v $dir/executors/python3:/executor_python3:ro \
|
||||
-v $dir/executors/ruby:/executor_ruby:ro \
|
||||
|
@ -79,6 +85,7 @@ docker run \
|
|||
piston \
|
||||
runuser \
|
||||
-l runner \
|
||||
-c "bash /$bin /$file $file ${@:3} 2>&1 | head -c 65536"
|
||||
-c "bash /$bin /$file $file 2>&1 | head -c 65536"
|
||||
|
||||
rm -f /tmp/$file
|
||||
rm -f /tmp/$arg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue