test
All checks were successful
CI Pipeline / shasums (push) Successful in 6s
git-sync-with-mirror / git-sync (push) Successful in 9s
CI Pipeline / build (push) Successful in 45s
CI Pipeline / tests (push) Successful in 30s
CI Pipeline / performance (push) Successful in 8s

This commit is contained in:
2025-11-05 21:41:46 -05:00
parent 175736caa2
commit 7268c573ea
2 changed files with 33 additions and 14 deletions

View File

@@ -99,9 +99,7 @@ function show_progress() {
#------------------------------ #------------------------------
function updbashrc() { function updbashrc() {
local repo_info local repo_info
local url
repo_info=$(_get_repo_urls) || return 1 repo_info=$(_get_repo_urls) || return 1
url="${repo_info%|*}"
# Step 1: Download checksum and _custom.sh # Step 1: Download checksum and _custom.sh
download_file "hyperterm/hyperterm.sha512" "$HYPERTERM_DIR/hyperterm.sha512" download_file "hyperterm/hyperterm.sha512" "$HYPERTERM_DIR/hyperterm.sha512"
@@ -130,22 +128,43 @@ function updbashrc() {
"Get your copy at: https://c.fridu.us/software/hyperterm.git" "Get your copy at: https://c.fridu.us/software/hyperterm.git"
printf '%b\n' "$RESET" printf '%b\n' "$RESET"
else else
msg "Fallo de checksum. Re-descargando archivos desde: $url" \ msg "Verificando archivos modificados..." \
"Checksum failed. Re-downloading files from: $url" "Checking for modified files..."
# Count total files to download # Step 3: Check each file individually and download only if needed
local total_files local files_to_update=()
total_files=$(wc -l < "$HYPERTERM_DIR/hyperterm.sha512")
local current_file=0 local current_file=0
# Step 3: Download all files from hyperterm.sha512 like list # First pass: identify files that need updating
while IFS= read -r line; do while IFS= read -r line; do
file=$(echo "$line" | cut -d' ' -f2) local expected_hash file_path
file=${file#./} expected_hash=$(echo "$line" | cut -d' ' -f1)
((current_file++)) file_path=$(echo "$line" | cut -d' ' -f2)
show_progress "$current_file" "$total_files" "Descargando $file" file_path=${file_path#./}
download_file "hyperterm/$file" "$HYPERTERM_DIR/$file" local full_path="$HYPERTERM_DIR/$file_path"
# Check if file exists and has correct hash
if [[ ! -f "$full_path" ]] || ! echo "$expected_hash ./$file_path" | (cd "$HYPERTERM_DIR" && sha512sum -c --quiet 2>/dev/null); then
files_to_update+=("$file_path")
fi
done < "$HYPERTERM_DIR/hyperterm.sha512" done < "$HYPERTERM_DIR/hyperterm.sha512"
local total_updates=${#files_to_update[@]}
if [[ $total_updates -eq 0 ]]; then
msg "✔️ Todos los archivos están actualizados" \
"✔️ All files are up to date"
else
msg "Descargando $total_updates archivo(s) modificado(s)..." \
"Downloading $total_updates modified file(s)..."
# Second pass: download only the files that need updating
for file_path in "${files_to_update[@]}"; do
((current_file++))
show_progress "$current_file" "$total_updates" "Actualizando $file_path"
download_file "hyperterm/$file_path" "$HYPERTERM_DIR/$file_path"
done
fi
_colors_bash "$@" _colors_bash "$@"
source "$HOME/.bashrc" source "$HOME/.bashrc"
fi fi

View File

@@ -1,6 +1,6 @@
cdfe049ec07f02a1893cda29c13085d06709e09a30b0c2e1111585278315f03139d61080c883cb3fd87f2bf64e05d9b5e5eaaad84c97ced890d83c73eb399fcb ../.bash_profile cdfe049ec07f02a1893cda29c13085d06709e09a30b0c2e1111585278315f03139d61080c883cb3fd87f2bf64e05d9b5e5eaaad84c97ced890d83c73eb399fcb ../.bash_profile
f363606f41a2c2c8f1cc44110c64fe23b1c8feb4c788ee006222db0f5c7a3adeac2b0948626b313adc985e9b8d303a0b9ce1c5ba42746810accb54efddcd4b84 ./hyperterm.sh f363606f41a2c2c8f1cc44110c64fe23b1c8feb4c788ee006222db0f5c7a3adeac2b0948626b313adc985e9b8d303a0b9ce1c5ba42746810accb54efddcd4b84 ./hyperterm.sh
c625e97dd0feb1d956f7f9bbe77e238eb57effc2951b320d20c652ca2d7b0ecfd18a772af61326d93ac5627316c8a2047a1cfe47fb90647fc3613623c7051941 ./core/update.sh 6a446970145083f6b9de0dd56e37f815afb7b332b843a75ff7f874724efe074f4c9cee08c6bd1bf8f972cdb34340b2b516a4eea9a25a3e2b5e3c39175bad7387 ./core/update.sh
1cfba599047d84a17ff92b695ebf527a505a30acc9ec21a2b9f410a7ea6dde4b23b5cf62e557d82f2fe9a8980649942424b879ca53baae4d4cb3057681baa7b6 ./core/colors.sh 1cfba599047d84a17ff92b695ebf527a505a30acc9ec21a2b9f410a7ea6dde4b23b5cf62e557d82f2fe9a8980649942424b879ca53baae4d4cb3057681baa7b6 ./core/colors.sh
c5ae12ee08361d1264fde5c73868fd0a80fd8810ac4e614cc333335679ad68d629d9bb88a04d27a8002d62f454105f1168df9ea63c7300c9272380b6d5311278 ./core/git.sh c5ae12ee08361d1264fde5c73868fd0a80fd8810ac4e614cc333335679ad68d629d9bb88a04d27a8002d62f454105f1168df9ea63c7300c9272380b6d5311278 ./core/git.sh
f3e00b2aa8ab9f3ab44570adaa2520408ed66fd00f551654d60b64a4be3546ec781b7efa39bcd774937e654b6ffb4c7af3f21eeb36caf9c01f82f85cf28e2b4d ./core/languages.sh f3e00b2aa8ab9f3ab44570adaa2520408ed66fd00f551654d60b64a4be3546ec781b7efa39bcd774937e654b6ffb4c7af3f21eeb36caf9c01f82f85cf28e2b4d ./core/languages.sh