Skip to content

Commit 5dc573a

Browse files
committed
Fixed errors when scripts ran from other dirs
Java couldn’t compile or run the files due to not being able to find them when the script was not run from the wargame directory. This new line changes the directory to the one that the script is in before compiling or running the files.
1 parent 1d0d1f9 commit 5dc573a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compile.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
javac -d "bin" -cp "source/wargame/" source/wargame/*.java
1+
cd ${0%/*}
2+
javac -d "bin" -cp "source/wargame/" source/wargame/*.java

run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
cd ${0%/*}
12
java -cp "bin" wargame/App

0 commit comments

Comments
 (0)