-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
48 lines (39 loc) · 785 Bytes
/
run.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
echo "Whish year would you like?/nYou can choose from:"
for file in *; do
if [ -d $file ]; then
echo " "$file
fi
done
# year="2021"
while [ -z $year ]; do
read year
done
if [ $year = "2021" ]; then
echo "Horrible year!"
else
echo "Great year!"
fi
echo "Now which day of the advent would you like to play?"
echo "Choose from:"
options=()
for file in $year/*; do
if [ -d $file ]; then
# exclude the input_data folder
if [ $file != $year/input_data ]; then
options+=($file)
fi
fi
done
select opt in "${options[@]}"; do
case $opt in
*)
cargo_path=$opt
break
;;
esac
done
echo "To play from "$cargo_path "press enter!"
read -s $start
cd $cargo_path
cargo run