mirror of
https://github.com/the-sane/lug-helper.git
synced 2024-12-28 16:34:21 +00:00
Ensure extracted directory matches archive name
This is how we detect installed items in download_select_install()
This commit is contained in:
parent
25b122e891
commit
9f2c72042e
@ -985,21 +985,21 @@ download_install() {
|
|||||||
message warning "The downloaded archive is empty. There is nothing to do."
|
message warning "The downloaded archive is empty. There is nothing to do."
|
||||||
elif [ "$num_dirs" -eq 1 ] && [ "$num_files" -eq 0 ]; then
|
elif [ "$num_dirs" -eq 1 ] && [ "$num_files" -eq 0 ]; then
|
||||||
# If the archive contains only one directory, install that directory
|
# If the archive contains only one directory, install that directory
|
||||||
debug_print continue "Installing $download_type into $download_dir/$extracted_dir..."
|
# We rename it to the name of the archive in case it is different
|
||||||
|
# so we can easily detect installed items in download_select_install()
|
||||||
|
debug_print continue "Installing $download_type into $download_dir/$download_name..."
|
||||||
if [ "$use_zenity" -eq 1 ]; then
|
if [ "$use_zenity" -eq 1 ]; then
|
||||||
# Use Zenity progress bar
|
# Use Zenity progress bar
|
||||||
mkdir -p "$download_dir" && cp -r "$tmp_dir"/"$download_name"/* "$download_dir" | \
|
mkdir -p "$download_dir" && cp -r "$tmp_dir/$download_name/$extracted_dir" "$download_dir/$download_name" | \
|
||||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing ${download_type}...\n" 2>/dev/null
|
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing ${download_type}...\n" 2>/dev/null
|
||||||
else
|
else
|
||||||
mkdir -p "$download_dir" && cp -r "$tmp_dir"/"$download_name"/* "$download_dir"
|
mkdir -p "$download_dir" && cp -r "$tmp_dir/$download_name/$extracted_dir" "$download_dir/$download_name"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We need to restart Lutris for the download to be detected
|
# We need to restart Lutris for the download to be detected
|
||||||
lutris_needs_restart="true"
|
lutris_needs_restart="true"
|
||||||
|
|
||||||
# Store the final name of the downloaded directory
|
# Store the final name of the downloaded directory
|
||||||
downloaded_item_name="$extracted_dir"
|
downloaded_item_name="$download_name"
|
||||||
|
|
||||||
# Trigger the post_download() function
|
# Trigger the post_download() function
|
||||||
trigger_post_download="true"
|
trigger_post_download="true"
|
||||||
elif [ "$num_dirs" -gt 1 ] || [ "$num_files" -gt 0 ]; then
|
elif [ "$num_dirs" -gt 1 ] || [ "$num_files" -gt 0 ]; then
|
||||||
@ -1016,10 +1016,8 @@ download_install() {
|
|||||||
|
|
||||||
# We need to restart Lutris for the download to be detected
|
# We need to restart Lutris for the download to be detected
|
||||||
lutris_needs_restart="true"
|
lutris_needs_restart="true"
|
||||||
|
|
||||||
# Store the final name of the downloaded directory
|
# Store the final name of the downloaded directory
|
||||||
downloaded_item_name="$download_name"
|
downloaded_item_name="$download_name"
|
||||||
|
|
||||||
# Trigger the post_download() function
|
# Trigger the post_download() function
|
||||||
trigger_post_download="true"
|
trigger_post_download="true"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user