@@ -87,6 +87,44 @@ progress_bar() {
87
87
printf " ] ${BOLD} %d%%${RESET} " $percentage
88
88
}
89
89
90
+ # Compare commit SHAs between repos
91
+ compare_commits () {
92
+ local main_repo=" aayush2622/Dartotsu"
93
+ local alpha_repo=" grayankit/Dartotsu-Downloader"
94
+
95
+ echo -ne " ${CYAN}${ICON_INFO}${RESET} Checking commit synchronization..."
96
+
97
+ # Get latest commits from both repos
98
+ local main_commit=$( curl -s " https://api.github.com/repos/${main_repo} /commits" | grep ' "sha"' | head -1 | cut -d ' "' -f 4 | cut -c1-7)
99
+ local main_date=$( curl -s " https://api.github.com/repos/${main_repo} /commits" | grep ' "date"' | head -1 | cut -d ' "' -f 4)
100
+
101
+ local alpha_release=$( curl -s " https://api.github.com/repos/${alpha_repo} /releases/latest" )
102
+ local alpha_tag=$( echo " $alpha_release " | grep ' "tag_name"' | cut -d ' "' -f 4)
103
+ local alpha_date=$( echo " $alpha_release " | grep ' "published_at"' | cut -d ' "' -f 4)
104
+
105
+ echo -e " ${GREEN}${ICON_SUCCESS}${RESET} "
106
+ echo
107
+ echo -e " ${BOLD}${BLUE} ╭─ COMMIT COMPARISON ────────────────────────────────╮${RESET} "
108
+ echo -e " ${BOLD}${BLUE} │${RESET} Main Repo (${main_repo} ): ${BLUE}${BOLD} │${RESET} "
109
+ echo -e " ${BOLD}${BLUE} │${RESET} Latest Commit: ${YELLOW}${main_commit}${RESET} ${BLUE}${BOLD} │${RESET} "
110
+ echo -e " ${BOLD}${BLUE} │${RESET} Date: ${GRAY} $( date -d " $main_date " ' +%Y-%m-%d %H:%M:%S' ) ${RESET} ${BLUE}${BOLD} │${RESET} "
111
+ echo -e " ${BOLD}${BLUE} │${RESET} ${BLUE}${BOLD} │${RESET} "
112
+ echo -e " ${BOLD}${BLUE} │${RESET} Alpha Repo (${alpha_repo} ): ${BLUE}${BOLD} │${RESET} "
113
+ echo -e " ${BOLD}${BLUE} │${RESET} Latest Tag: ${PURPLE}${alpha_tag}${RESET} ${BLUE}${BOLD} │${RESET} "
114
+ echo -e " ${BOLD}${BLUE} │${RESET} Date: ${GRAY} $( date -d " $alpha_date " ' +%Y-%m-%d %H:%M:%S' ) ${RESET} ${BLUE}${BOLD} │${RESET} "
115
+ echo -e " ${BOLD}${BLUE} │${RESET} ${BLUE}${BOLD} │${RESET} "
116
+
117
+ # Check if commits match (simplified comparison)
118
+ if [[ " $alpha_tag " == * " $main_commit " * ]]; then
119
+ echo -e " ${BOLD}${BLUE} │${RESET} Status: ${GREEN}${ICON_SUCCESS} Synchronized${RESET} ${BLUE}${BOLD} │${RESET} "
120
+ else
121
+ echo -e " ${BOLD}${BLUE} │${RESET} Status: ${YELLOW}${ICON_WARNING} Out of sync${RESET} ${BLUE}${BOLD} │${RESET} "
122
+ fi
123
+
124
+ echo -e " ${BOLD}${BLUE} ╰────────────────────────────────────────────────────╯${RESET} "
125
+ echo
126
+ }
127
+
90
128
# Animated text typing effect
91
129
type_text () {
92
130
local text=" $1 "
@@ -172,16 +210,18 @@ show_menu() {
172
210
}
173
211
174
212
# Version selection menu
213
+ # Replace the existing version_menu function with:
175
214
version_menu () {
176
215
echo
177
216
echo -e " ${BOLD}${CYAN} ┌─ VERSION SELECTION ────────────────────────────────┐${RESET} "
178
217
echo -e " ${BOLD}${CYAN} │${RESET} ${CYAN}${BOLD} │${RESET} "
179
218
echo -e " ${BOLD}${CYAN} │${RESET} ${ICON_ROCKET} ${GREEN}${BOLD} [S]${RESET} Stable Release ${GRAY} (Recommended)${RESET} ${CYAN}${BOLD} │${RESET} "
180
219
echo -e " ${BOLD}${CYAN} │${RESET} ${ICON_SPARKLES} ${YELLOW}${BOLD} [P]${RESET} Pre-release ${GRAY} (Latest Features)${RESET} ${CYAN}${BOLD} │${RESET} "
220
+ echo -e " ${BOLD}${CYAN} │${RESET} ${ICON_SPARKLES} ${PURPLE}${BOLD} [A]${RESET} Alpha Build ${GRAY} (Experimental)${RESET} ${CYAN}${BOLD} │${RESET} "
181
221
echo -e " ${BOLD}${CYAN} │${RESET} ${CYAN}${BOLD} │${RESET} "
182
222
echo -e " ${BOLD}${CYAN} └────────────────────────────────────────────────────┘${RESET} "
183
223
echo
184
- echo -ne " ${BOLD}${WHITE} Your choice${RESET} ${GRAY} (S/P)${RESET} : "
224
+ echo -ne " ${BOLD}${WHITE} Your choice${RESET} ${GRAY} (S/P/A )${RESET} : "
185
225
}
186
226
187
227
# =============================================================================
@@ -439,20 +479,29 @@ install_app() {
439
479
read -n 1 ANSWER
440
480
echo
441
481
442
- case " ${ANSWER,,} " in
443
- p)
444
- API_URL=" https://api.github.com/repos/$OWNER /$REPO /releases"
445
- info_msg " Fetching pre-release versions..."
446
- ;;
447
- s|" " )
448
- API_URL=" https://api.github.com/repos/$OWNER /$REPO /releases/latest"
449
- info_msg " Fetching stable release..."
450
- ;;
451
- * )
452
- warn_msg " Invalid selection, defaulting to stable release..."
453
- API_URL=" https://api.github.com/repos/$OWNER /$REPO /releases/latest"
454
- ;;
455
- esac
482
+ # Replace the case statement with:
483
+ case " ${ANSWER,,} " in
484
+ p)
485
+ API_URL=" https://api.github.com/repos/$OWNER /$REPO /releases"
486
+ info_msg " Fetching pre-release versions..."
487
+ ;;
488
+ a)
489
+ OWNER=" grayankit"
490
+ REPO=" Dartotsu-Downloader"
491
+ API_URL=" https://api.github.com/repos/$OWNER /$REPO /releases/latest"
492
+ info_msg " Fetching alpha build..."
493
+ echo
494
+ compare_commits
495
+ ;;
496
+ s|" " )
497
+ API_URL=" https://api.github.com/repos/$OWNER /$REPO /releases/latest"
498
+ info_msg " Fetching stable release..."
499
+ ;;
500
+ * )
501
+ warn_msg " Invalid selection, defaulting to stable release..."
502
+ API_URL=" https://api.github.com/repos/$OWNER /$REPO /releases/latest"
503
+ ;;
504
+ esac
456
505
457
506
# Fetch release info
458
507
ASSET_URL=$( curl -s " $API_URL " | grep browser_download_url | cut -d ' "' -f 4 | grep .zip | head -n 1)
0 commit comments