Skip to content

Commit

Permalink
Fix installing packages and detecting installed packages
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye116477 committed Jan 26, 2022
1 parent 2f26625 commit 62d0bcb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions install_waterfox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ cd "$Dir" || exit
echo "Detecting installable/installed packages..."
mapfile -t Packages < <(find "$Dir" -type f -regextype posix-extended -regex ".*waterfox-(classic|current|G3|g3|G4|g4).*(tar\.bz2|AppImage)")

if [[ ${#Packages[@]} -eq 0 && -d "$InstallDirectory" ]]; then
mapfile -t Packages < <(find "$InstallDirectory" -type d -regextype posix-extended -regex ".*waterfox-(classic|current|G3|g3|G4|g4)")
if [[ -d "$InstallDirectory" ]]; then
mapfile -t -O "${#Packages[@]}" Packages < <(find "$InstallDirectory" -type d -regextype posix-extended -regex ".*waterfox-(classic|current|G3|g3|G4|g4)")
fi

if [ "${#Packages[@]}" ]; then
Expand Down Expand Up @@ -136,7 +136,7 @@ fi

chosenPackages=()
for package in "${Packages[@]}"; do
if [[ "$(basename -- "$package")" =~ ^waterfox-"$packageTypeName".*(tar\.bz2|AppImage) ]]; then
if [[ "$(basename -- "$package")" =~ ^waterfox-$packageTypeName.*(tar\.bz2|AppImage) ]]; then
chosenPackages+=("$package")
fi
done
Expand Down

0 comments on commit 62d0bcb

Please sign in to comment.