-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile
More file actions
executable file
·36 lines (28 loc) · 759 Bytes
/
compile
File metadata and controls
executable file
·36 lines (28 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
function makeNmove() {
if [ ! -d executablejava ]; then
mkdir "executablejava"
fi
mv *.class executablejava
}
while :; do
case $1 in
-h|--help) echo "compile is used for javac (java compiler), it creates a folder called 'executable' and moves '.class' files in there
-h || --help this screen appears
-o || --only [arg] this parameter takes an argument. If you want to compile only one java file you compile with this"
;;
-o|--only) if [ "$2" != "" ]; then
javac "$2"
makeNmove
else
echo "Invalid argument, you need to write which java file must be only compiled."
fi
;;
*) break
esac
shift
done
if [ "$#" -eq 0 ]; then
javac *.java
makeNmove
fi