-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.sh
35 lines (30 loc) · 798 Bytes
/
start.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
#!/usr/bin/env bash
MAIN_PATH=files
DIRECTORY_NEED=(quotes movies spicy-memes university)
echo "Starting..."
echo ""
echo "Checking for Cargo..."
(command -v cargo >/dev/null 2>&1 && echo "Cargo is installed" ) || { echo >&2 "Cargo is not installed.\nAborting."; exit 1;}
echo ""
echo "Setting up..."
echo ""
if [[ -d "${MAIN_PATH}" ]]; then
echo "${MAIN_PATH}/ exits..."
else
echo "Creating ${MAIN_PATH}..."
mkdir "${MAIN_PATH}"
fi
cd "${MAIN_PATH}"
echo "${MAIN_PATH}/..."
for directory_name in "${DIRECTORY_NEED[@]}"; do
if [[ -d "${directory_name}" ]]; then
echo "${MAIN_PATH}/${directory_name}/ exits..."
else
echo "Creating ${MAIN_PATH}/${directory_name}..."
mkdir "$directory_name"
fi
done
cd ..
echo ""
echo "Cargo build..."
cargo build