-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdone
More file actions
executable file
·88 lines (73 loc) · 2.67 KB
/
done
File metadata and controls
executable file
·88 lines (73 loc) · 2.67 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env bash
# █░█ ▄▀█ █▀█ █ ▄▀█ █▄▄ █░░ █▀▀ █▀
# ▀▄▀ █▀█ █▀▄ █ █▀█ █▄█ █▄▄ ██▄ ▄█
# ================================
BLK='\033[1;30m' RED='\033[1;31m' GRN='\033[1;32m' YLO='\033[1;33m'
BLU='\033[1;34m' PNK='\033[1;35m' CYN='\033[1;36m' WHT='\033[1;37m'
DEF='\033[0;39m' RESET='\033[0;0m'
U='\033[4m' # Underline
X=${RESET}
Y=${YLO}
R=${RED}
B=${BLU}
G=${GRN}
echo
echo -e "${R}█▀▀ █░█ █▀▀ █▀▀ █▄▀ █ █▄░█ █▀▀ ${X}▄▀█ █▀ █▀ █▀▀ ▀█▀ █▀"
echo -e "${R}█▄▄ █▀█ ██▄ █▄▄ █░█ █ █░▀█ █▄█ ${X}█▀█ ▄█ ▄█ ██▄ ░█░ ▄█"
echo -e "====================================================="
missing_count=0
missing_files=()
dirs=("blur" "cover" "icon")
get_filename() {
echo "$(basename ${1%.*})"
}
check_file_existence() {
local file="$1"
local dir="$2"
if [[ ! -f "$dir/$file.jpg" && ! -f "$dir/$file.png" ]]; then
return 1
fi
return 0
}
for banner_file in public/banner/*; do
base_file=$(get_filename "$banner_file")
for dir in "${dirs[@]}"; do
if ! check_file_existence "$base_file" "public/$dir"; then
missing_count=$((missing_count + 1))
missing_files+=("${R}$base_file${X} $dir")
fi
done
done
# Prompt if missing files
if ((missing_count > 0)); then
echo "❌ Missing files($missing_count):"
for entry in "${missing_files[@]}"; do
echo -e "$entry"
done
read -p "Continue with the build script? (y/N): " choice
if [[ "$choice" != "y" ]]; then
echo "Build aborted due to missing files."
exit 0
fi
fi
echo -e "${G}✅ Proceeding to deploy${X}"
echo
echo -e "${Y}█▀▄ █▀▀ █▀█ █░░ █▀█ █▄█ █ █▄░█ █▀▀ ${X}█▄▄ █░█ █ █░░ █▀▄"
echo -e "${Y}█▄▀ ██▄ █▀▀ █▄▄ █▄█ ░█░ █ █░▀█ █▄█ ${X}█▄█ █▄█ █ █▄▄ █▄▀"
echo -e "======================================================"
echo "Enter a commit message (press Enter for no message):"
read commit_message
if [ -z "$commit_message" ]; then
ng deploy --repo=git@github.com:MidHunterX/Game-Trackr.git --base-href="/Game-Trackr/"
else
ng deploy --message="$commit_message" --repo=git@github.com:MidHunterX/Game-Trackr.git --base-href="/Game-Trackr/"
fi
build_status=$? # Capture exit status
if [ $build_status -eq 0 ]; then
echo
echo -e "${G}█▀▄ █▀█ █▄░█ █▀▀ █ ${X}"
echo -e "${G}█▄▀ █▄█ █░▀█ ██▄ ▄ ${X}"
else
echo
echo -e "❌ ${RED}BUILD FAILED${X}"
fi