From c20e91e1e8f2b6719ed4719dbbb9e6cfde30f315 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Thu, 5 Sep 2024 18:20:55 -0400 Subject: [PATCH] Fix merge goof --- lug-helper.sh | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 1f19c2f..46482b7 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -1112,6 +1112,7 @@ download_file() { download_url="${1// /%20}" download_filename="$2" download_type="$3" + echo "DEBUG: $download_url" # Download the item to the tmp directory debug_print continue "Downloading $download_url into $tmp_dir/$download_filename..." @@ -1140,47 +1141,6 @@ download_file() { fi } -# Download a file to the tmp directory -# Expects two arguments, the download URL and the file name -download_file() { - # This function expects two string arguments - if [ "$#" -lt 2 ]; then - printf "\nScript error: The download_file function expects two arguments. Aborting.\n" - read -n 1 -s -p "Press any key..." - exit 0 - fi - - # Capture the arguments - download_url="$1" - download_filename="$2" - - # Download the item to the tmp directory - debug_print continue "Downloading $download_url into $tmp_dir/$download_filename..." - if [ "$use_zenity" -eq 1 ]; then - # Format the curl progress bar for zenity - mkfifo "$tmp_dir/lugpipe" - cd "$tmp_dir" && curl -#LO "$download_url" > "$tmp_dir/lugpipe" 2>&1 & curlpid="$!" - stdbuf -oL tr '\r' '\n' < "$tmp_dir/lugpipe" | \ - grep --line-buffered -ve "100" | grep --line-buffered -o "[0-9]*\.[0-9]" | \ - ( - trap 'kill "$curlpid"' ERR - zenity --progress --auto-close --title="Star Citizen LUG Helper" --text="Downloading ${download_type}. This might take a moment.\n" 2>/dev/null - ) - - if [ "$?" -eq 1 ]; then - # User clicked cancel - debug_print continue "Download aborted. Removing $tmp_dir/$download_filename..." - rm --interactive=never "${tmp_dir:?}/$download_filename" - rm --interactive=never "${tmp_dir:?}/lugpipe" - return 1 - fi - rm --interactive=never "${tmp_dir:?}/lugpipe" - else - # Standard curl progress bar - (cd "$tmp_dir" && curl -LO "$download_url") - fi -} - # Detect which version of Lutris is running and restart it lutris_restart() { # Detect the installed versions of Lutris