Merge pull request #66 from Vrganj/run-java-directly

Run Java directly to avoid grep
This commit is contained in:
Brian Seymour 2021-02-03 21:48:12 -06:00 committed by GitHub
commit 6615ec4519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -1,7 +1,5 @@
#!/bin/bash #!/bin/bash
cd /tmp/$2 cp code.code interim.java
name=$(grep -Po "(?<=\n|\A)\s*(public\s+)?(class|interface)\s+\K([^\/\\\\\n\s{]+)" code.code) timeout -s KILL 10 xargs -a args.args -d '\n' java interim.java < stdin.stdin
cp code.code $name.java
javac $name.java
timeout -s KILL 3 xargs -a args.args -d '\n' java $name < stdin.stdin