flatpak-manage.sh: improve detection of flatpak bin
When running this script from a NixOS systemd service, the PATH is "isolated". And adding the path of the flatpak package to PATH would likely just install the flatpak package too. Which is not intentional for non-desktop systems. So, use this hack or whatever.
This commit is contained in:
parent
ff3d3e608a
commit
1297284712
|
@ -37,12 +37,16 @@ else
|
|||
fi
|
||||
|
||||
if command -v flatpak > /dev/null; then
|
||||
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak install --user --or-update --assumeyes --noninteractive "${ALL_PKGS[@]}"
|
||||
flatpak update --user --assumeyes --noninteractive
|
||||
flatpak uninstall --user --unused --assumeyes --noninteractive --delete-data
|
||||
flatpak repair --user
|
||||
FLATPAK_BIN="$(command -v flatpak)"
|
||||
elif [[ -x '/run/current-system/sw/bin/flatpak' ]]; then
|
||||
FLATPAK_BIN='/run/current-system/sw/bin/flatpak'
|
||||
else
|
||||
echo 'Flatpak not found, exiting cleanly nonetheless'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
${FLATPAK_BIN} remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
${FLATPAK_BIN} install --user --or-update --assumeyes --noninteractive "${ALL_PKGS[@]}"
|
||||
${FLATPAK_BIN} update --user --assumeyes --noninteractive
|
||||
${FLATPAK_BIN} uninstall --user --unused --assumeyes --noninteractive --delete-data
|
||||
${FLATPAK_BIN} repair --user
|
||||
|
|
Loading…
Reference in New Issue