Fix url formatting with command-line arguments

This commit is contained in:
the-sane 2023-08-01 12:04:59 -04:00
parent 0d2845b614
commit 3f4c1eaab2

View File

@ -2331,6 +2331,15 @@ eac_workaround() {
fi fi
} }
# Format some URLs for Zenity
format_urls() {
if [ "$use_zenity" -eq 1 ]; then
releases_url="<a href='$releases_url'>$releases_url</a>"
lug_wiki="<a href='$lug_wiki'>$lug_wiki</a>"
lug_wiki_nixos="<a href='$lug_wiki_nixos'>$lug_wiki_nixos</a>"
fi
}
# Get a random Penguin's Star Citizen referral code # Get a random Penguin's Star Citizen referral code
referral_randomizer() { referral_randomizer() {
# Populate the referral codes array # Populate the referral codes array
@ -2378,11 +2387,9 @@ fi
# Set defaults # Set defaults
live_or_ptu="$live_dir" live_or_ptu="$live_dir"
# Format some URLs for Zenity # Format some URLs for Zenity if the Helper was not invoked with command-line arguments (handle those separately below)
if [ "$use_zenity" -eq 1 ]; then if [ "$#" -eq 0 ]; then
releases_url="<a href='$releases_url'>$releases_url</a>" format_urls
lug_wiki="<a href='$lug_wiki'>$lug_wiki</a>"
lug_wiki_nixos="<a href='$lug_wiki_nixos'>$lug_wiki_nixos</a>"
fi fi
# Check if a newer verison of the script is available # Check if a newer verison of the script is available
@ -2497,6 +2504,9 @@ Usage: lug-helper <options>
shift shift
done done
# Format some URLs for Zenity
format_urls
# Call the requested functions and exit # Call the requested functions and exit
if [ "${#cargs[@]}" -gt 0 ]; then if [ "${#cargs[@]}" -gt 0 ]; then
for (( x=0; x<"${#cargs[@]}"; x++ )); do for (( x=0; x<"${#cargs[@]}"; x++ )); do