mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-10-11 07:02:20 +00:00
Use new progress_bar function in download_install
This commit is contained in:
@@ -1614,15 +1614,12 @@ download_install() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Show a zenity pulsating progress bar
|
||||||
|
progress_bar start "Installing ${download_type}. Please wait..."
|
||||||
|
|
||||||
# Extract the archive to the tmp directory
|
# Extract the archive to the tmp directory
|
||||||
debug_print continue "Extracting $download_type into $tmp_dir/$download_basename..."
|
debug_print continue "Extracting $download_type into $tmp_dir/$download_basename..."
|
||||||
if [ "$use_zenity" -eq 1 ]; then
|
mkdir "$tmp_dir/$download_basename" && tar -xf "$tmp_dir/$download_filename" -C "$tmp_dir/$download_basename"
|
||||||
# Use Zenity progress bar
|
|
||||||
mkdir "$tmp_dir/$download_basename" && tar -xf "$tmp_dir/$download_filename" -C "$tmp_dir/$download_basename" | \
|
|
||||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Extracting ${download_type}...\n" 2>/dev/null
|
|
||||||
else
|
|
||||||
mkdir "$tmp_dir/$download_basename" && tar -xf "$tmp_dir/$download_filename" -C "$tmp_dir/$download_basename"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check the contents of the extracted archive to determine the
|
# Check the contents of the extracted archive to determine the
|
||||||
# directory structure we must create upon installation
|
# directory structure we must create upon installation
|
||||||
@@ -1656,13 +1653,9 @@ download_install() {
|
|||||||
else
|
else
|
||||||
debug_print continue "Installing $download_type into ${download_dirs[i]}/$download_basename..."
|
debug_print continue "Installing $download_type into ${download_dirs[i]}/$download_basename..."
|
||||||
fi
|
fi
|
||||||
if [ "$use_zenity" -eq 1 ]; then
|
|
||||||
# Use Zenity progress bar
|
# Copy the directory to the destination
|
||||||
mkdir -p "${download_dirs[i]}" && cp -r "$tmp_dir/$download_basename/$extracted_dir" "${download_dirs[i]}/$download_basename" | \
|
mkdir -p "${download_dirs[i]}" && cp -r "$tmp_dir/$download_basename/$extracted_dir" "${download_dirs[i]}/$download_basename"
|
||||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing ${download_type}...\n" 2>/dev/null
|
|
||||||
else
|
|
||||||
mkdir -p "${download_dirs[i]}" && cp -r "$tmp_dir/$download_basename/$extracted_dir" "${download_dirs[i]}/$download_basename"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Store the final name of the downloaded item
|
# Store the final name of the downloaded item
|
||||||
@@ -1683,13 +1676,9 @@ download_install() {
|
|||||||
else
|
else
|
||||||
debug_print continue "Installing $download_type into ${download_dirs[i]}/$download_basename..."
|
debug_print continue "Installing $download_type into ${download_dirs[i]}/$download_basename..."
|
||||||
fi
|
fi
|
||||||
if [ "$use_zenity" -eq 1 ]; then
|
|
||||||
# Use Zenity progress bar
|
# Copy the directory to the destination
|
||||||
mkdir -p "${download_dirs[i]}/$download_basename" && cp -r "$tmp_dir"/"$download_basename"/* "${download_dirs[i]}"/"$download_basename" | \
|
mkdir -p "${download_dirs[i]}/$download_basename" && cp -r "$tmp_dir"/"$download_basename"/* "${download_dirs[i]}"/"$download_basename"
|
||||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing ${download_type}...\n" 2>/dev/null
|
|
||||||
else
|
|
||||||
mkdir -p "${download_dirs[i]}/$download_basename" && cp -r "$tmp_dir"/"$download_basename"/* "${download_dirs[i]}"/"$download_basename"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Store the final name of the downloaded item
|
# Store the final name of the downloaded item
|
||||||
@@ -1701,6 +1690,8 @@ download_install() {
|
|||||||
debug_print exit "Script error: Unexpected archive contents in download_install function. Aborting"
|
debug_print exit "Script error: Unexpected archive contents in download_install function. Aborting"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
progress_bar stop # Stop the zenity progress window
|
||||||
|
|
||||||
# Cleanup tmp download
|
# Cleanup tmp download
|
||||||
debug_print continue "Cleaning up $tmp_dir/$download_filename..."
|
debug_print continue "Cleaning up $tmp_dir/$download_filename..."
|
||||||
rm --interactive=never "${tmp_dir:?}/$download_filename"
|
rm --interactive=never "${tmp_dir:?}/$download_filename"
|
||||||
|
Reference in New Issue
Block a user