-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate.sh
executable file
·47 lines (38 loc) · 1.49 KB
/
generate.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
#!/bin/bash
# Color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
COLOR_RESET='\033[0m' # No Color
# Log the start of the script
echo -e "----------------------------------------"
echo -e "${ORANGE}SCRIPT STARTED...${COLOR_RESET}"
echo -e "----------------------------------------"
# Check if src/new-svgs folder is empty
if [ -n "$(ls -A src/new-svgs)" ]; then
# Run script 1
./sh-scripts/gen_icon_c.sh
# Check if script 1 ran successfully
if [ $? -eq 0 ]; then
echo -e "${ORANGE}components created successfully.${COLOR_RESET}"
echo -e "${ORANGE}setting up for stories.${COLOR_RESET}"
# Run script 3 after script 2 completes
./sh-scripts/gen_story.sh
# Check if script 3 ran successfully
if [ $? -eq 0 ]; then
echo -e "${ORANGE}stories created successfully.${COLOR_RESET}"
# Log the end of the script
echo -e "----------------------------------------"
echo -e "${GREEN}GENERATE COMPONENTS AND STORIES SUCCESSFULLY.${COLOR_RESET}"
echo -e "----------------------------------------"
else
echo -e "${RED}creating stories failed. Exiting...${COLOR_RESET}"
exit 1
fi
else
echo -e "${RED}creating stories failed. Exiting...${COLOR_RESET}"
exit 1
fi
else
echo -e "${RED}[src/new-svgs] folder is empty. No scripts to run.${COLOR_RESET}"
fi