Skip to content

Commit

Permalink
No need to check for wget in update routine as we check for curl duri…
Browse files Browse the repository at this point in the history
…ng normal runtime

Signed-off-by: yubiuser <[email protected]>
  • Loading branch information
yubiuser committed Jul 18, 2024
1 parent d1707e5 commit f918bff
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions padd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1613,26 +1613,12 @@ Update() {

padd_script_path=$(realpath "$0")

if which wget > /dev/null 2>&1; then
echo "${check_box_info} Downloading PADD update via wget ..."
if wget -qO "${padd_script_path}" https://install.padd.sh > /dev/null 2>&1; then
echo "${check_box_good} ... done. Restart PADD for the update to take effect"
else
echo "${check_box_bad} Cannot download PADD update via wget"
echo "${check_box_info} Go to https://install.padd.sh to download the update manually"
exit 1
fi
elif which curl > /dev/null 2>&1; then
echo "${check_box_info} Downloading PADD update via curl ..."
if curl -sSL https://install.padd.sh -o "${padd_script_path}" > /dev/null 2>&1; then
echo "${check_box_good} ... done. Restart PADD for the update to take effect"
else
echo "${check_box_bad} Cannot download PADD update via curl"
echo "${check_box_info} Go to https://install.padd.sh to download the update manually"
exit 1
fi
echo "${check_box_info} Downloading PADD update ..."

if curl -sSL https://install.padd.sh -o "${padd_script_path}" > /dev/null 2>&1; then
echo "${check_box_good} ... done. Restart PADD for the update to take effect"
else
echo "${check_box_bad} Cannot download, neither wget nor curl are available"
echo "${check_box_bad} Cannot download PADD update"
echo "${check_box_info} Go to https://install.padd.sh to download the update manually"
exit 1
fi
Expand Down Expand Up @@ -1720,6 +1706,9 @@ TerminalResize(){
}

main(){

check_dependencies

# Hiding the cursor.
# https://vt100.net/docs/vt510-rm/DECTCEM.html
printf '\e[?25l'
Expand Down Expand Up @@ -1757,5 +1746,4 @@ while [ "$#" -gt 0 ]; do
shift
done

check_dependencies
main

0 comments on commit f918bff

Please sign in to comment.