File tree 2 files changed +29
-1
lines changed
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ generatemap () {
59
59
for f in {1..30}
60
60
do
61
61
printf " ${C_GRY} .${C_RES} "
62
- ./ $BASE /generator " $2 " > " $BASE /maps/$1 $( printf ' %02d' $f ) "
62
+ $BASE /generator " $2 " > " $BASE /maps/$1 $( printf ' %02d' $f ) "
63
63
sleep 1
64
64
done
65
65
}
@@ -76,6 +76,9 @@ runtest () {
76
76
}
77
77
78
78
# ############################
79
+ fileexist " $PROJECT_PATH /lem-in"
80
+ fileisexecutable " $PROJECT_PATH /lem-in"
81
+
79
82
generate=1
80
83
if [ -d " $BASE /maps" ]; then
81
84
read -p " Would you like to generate new maps [y/N]? " -n 1 -r
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ # #
4
+ # Print
5
+ # #
3
6
printtest () {
4
7
printf " ${C_CYA}${C_UND} \nTest:${C_RESU} ${1}${C_RES} \n"
5
8
}
@@ -13,7 +16,29 @@ printerror () {
13
16
}
14
17
15
18
19
+ # #
20
+ # Others
21
+ # #
16
22
waitkeypress () {
17
23
printf " ${C_GRY} Press enter to continue...${C_RES} "
18
24
read
19
25
}
26
+
27
+ # #
28
+ # File tests
29
+ # #
30
+
31
+ fileexist () {
32
+ if ! [ -f " $1 " ]; then
33
+ printerror " File $1 does not exist."
34
+ exit 1
35
+ fi
36
+ }
37
+
38
+ fileisexecutable () {
39
+ if ! [ -x " $1 " ]; then
40
+ printerror " File $1 is not executable."
41
+ printinfo " You can try to run 'chmod u+x $1 ' to fix this"
42
+ exit 1
43
+ fi
44
+ }
You can’t perform that action at this time.
0 commit comments