Skip to content

Commit f13d00c

Browse files
ggtrdggtrd
authored andcommitted
Fix HTTP check
1 parent 1fc4f64 commit f13d00c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

bashpack.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ download_cli() {
456456

457457
# Download source scripts
458458
# Testing if repository is reachable with HTTP before doing anything.
459-
if ! export function_to_launch="check_repository_reachability" && exec $COMMAND_VERIFY_INTALLATION | grep -q 'Error:'; then
459+
if ! check_repository_reachability | grep -q 'Error:'; then
460460
# Try to download with curl if exists
461461
echo -n "Downloading sources from $archive_url "
462462
if [[ $(exists_command "curl") = "exists" ]]; then
@@ -475,8 +475,9 @@ download_cli() {
475475
else
476476
error_file_not_downloaded $archive_url
477477
fi
478-
# else
479-
# echo "Error: sources can't be downloaded because the repository is not reachable."
478+
else
479+
# Just call again the same function to get its error message
480+
check_repository_reachability
480481
fi
481482

482483
}
@@ -660,7 +661,7 @@ update_cli() {
660661
# # To avoid broken installations, before deleting anything, testing if downloaded archive is a working tarball.
661662
# # (archive is deleted in create_cli, which is called after in the process)
662663
# # if ! $NAME_LOWERCASE verify -d | grep -q 'Error:'; then
663-
# if ! check_repository_reachability | grep -q 'Error:'; then
664+
if ! check_repository_reachability | grep -q 'Error:'; then
664665

665666
# Download latest available version
666667
download_cli "$URL/tarball" $archive_tmp $archive_dir_tmp
@@ -670,9 +671,9 @@ update_cli() {
670671

671672
# Execute the install_cli function of the script downloaded in /tmp
672673
exec "$archive_dir_tmp/$NAME_LOWERCASE.sh" -i
673-
# else
674-
# error_tarball_non_working $archive_tmp
675-
# fi
674+
else
675+
error_tarball_non_working $archive_tmp
676+
fi
676677
fi
677678
}
678679

0 commit comments

Comments
 (0)