summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/jrun16
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
+