run script updated for Gradle support

This commit is contained in:
Josh Ashton
2023-06-23 14:52:33 -06:00
parent 550906075a
commit 243808ac82
2 changed files with 10 additions and 2 deletions
+9 -1
View File
@@ -8,6 +8,7 @@ if [[ $# -gt 1 ]]; then
echo "Proper usage: run {file}"
echo " eg. run"
echo " eg. run main"
echo " eg. run --gradle"
echo " eg. run -h"
echo " eg. run --help"
@@ -24,6 +25,7 @@ elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo " run"
echo " run [filename]"
echo " eg. run main"
echo " run --gradle"
echo " run -h"
echo " run --help\n"
echo "Supported languages: $TYPES"
@@ -104,13 +106,13 @@ elif [[ $TYPE == "cs" ]]; then
# Run Java app.
elif [[ $TYPE == "java" ]]; then
clear
CP=.:../lib/*
echo "Compiling..."
javac -cp $CP *.java
echo "Output...";
java -cp $CP $NAME $ARGS
rm *.class
# Run JavaScript app.
elif [[ $TYPE == "js" ]]; then
clear
@@ -126,6 +128,12 @@ elif [[ $TYPE == "go" ]]; then
./discordo #TODO: need to dynamically obtain the newly created object file to run and then delete
rm discordo
# Run app through Gradle
elif [[ $1 == "--gradle" ]]; then
clear;
echo "Output..."
./gradlew run
else
read "?Language is not supported. Create a GH issue (y/n, default y): " GH
if [[ $GH == "y" || $GH == "" ]]; then