diff options
| author | krolxon <krolyxon@tutanota.com> | 2024-02-18 23:40:06 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2024-02-18 23:40:06 +0530 |
| commit | 15f325d5c5c960af5a44fc4b2269437cd2216fc8 (patch) | |
| tree | da47187731da1b6c58665016ae089a1e37962305 /.local/bin/jrun | |
| parent | fec5f2815954c85b573eeaae9f6b29f07974a4d5 (diff) | |
jrun
Diffstat (limited to '.local/bin/jrun')
| -rwxr-xr-x | .local/bin/jrun | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/.local/bin/jrun b/.local/bin/jrun index 907e99c..8445dd3 100755 --- a/.local/bin/jrun +++ b/.local/bin/jrun @@ -1,6 +1,14 @@ #!/bin/env bash -filename="${1%.*}" -\cp -f "$1" /tmp/"$1" -javac -d /tmp "$1" -java -cp /tmp "$filename" +# Script to run simple .java files. +# because its annoying to have .class files clutter your working directory; + +if [ -z $* ]; then + echo "usage: jrun <filename>" +else + filename="${1%.*}" + \cp -f "$1" /tmp/"$1" + javac -d /tmp "$1" + java -cp /tmp "$filename" +fi + |
