new extensions

This commit is contained in:
Brian Seymour 2018-09-20 22:17:46 -05:00
parent c55d472a7b
commit e9c952216b
3 changed files with 9 additions and 2 deletions

View File

@ -79,8 +79,14 @@ func Execute(res http.ResponseWriter, req *http.Request) {
}
func launch(inbound2 inbound, res http.ResponseWriter){
var ext string = "code";
if inbound2.Language == "go" {
ext = "go"
}
// write the code to temp dir
filename := fmt.Sprintf("/tmp/%d.code", time.Now().UnixNano())
filename := fmt.Sprintf("/tmp/%d." + ext, time.Now().UnixNano())
ioutil.WriteFile(filename, []byte(inbound2.Source), 0644)

View File

@ -52,6 +52,7 @@ docker run \
-m 16m \
--network none \
--cpus=".5" \
--ulimit nproc=8:16 \
--rm \
-v $abs:/$file \
-v $dir/executors/python2:/executor_python2 \

View File

@ -1,3 +1,3 @@
#!/bin/sh
go run $*
go run $1