feat(postinstall): only update pkgfile if packages were installed; propagate flag from all package modules

This commit is contained in:
Martin Büchler 2025-08-14 23:19:12 +02:00
parent 145e652380
commit 638fc47dc2
6 changed files with 8 additions and 7 deletions

View File

@ -36,6 +36,7 @@ done
if [ "${#to_install[@]}" -gt 0 ]; then
paru -S --noconfirm "${to_install[@]}"
export DOTFILES_PACKAGES_UPDATED=1
else
echo "All packages already installed."
fi

View File

@ -25,6 +25,7 @@ done
if [ "${#to_install[@]}" -gt 0 ]; then
paru -S --noconfirm "${to_install[@]}"
echo "Sound packages installed."
export DOTFILES_PACKAGES_UPDATED=1
else
echo "All sound packages already installed."
fi

View File

@ -33,6 +33,7 @@ done
if [ "${#to_install[@]}" -gt 0 ]; then
paru -S --noconfirm "${to_install[@]}"
echo "Hyprland and related tools installed and configured."
export DOTFILES_PACKAGES_UPDATED=1
else
echo "All Hyprland and related tools already installed."
fi

View File

@ -19,6 +19,7 @@ done
if [ "${#to_install[@]}" -gt 0 ]; then
paru -S --noconfirm "${to_install[@]}"
echo "Browsers installed."
export DOTFILES_PACKAGES_UPDATED=1
else
echo "All browsers already installed."
fi

View File

@ -28,6 +28,7 @@ done
if [ "${#to_install[@]}" -gt 0 ]; then
paru -S --noconfirm "${to_install[@]}"
echo "Development tools installed."
export DOTFILES_PACKAGES_UPDATED=1
else
echo "All development tools already installed."
fi

View File

@ -2,15 +2,11 @@
# Post-install steps for dotfiles setup
# Update pkgfile database for command-not-found suggestions
if command -v pkgfile &>/dev/null; then
if command -v pkgfile &>/dev/null && [ "$DOTFILES_PACKAGES_UPDATED" = "1" ]; then
echo "Updating pkgfile database..."
sudo pkgfile --update
fi
# Rehash zsh command hash table so new executables are found
if command -v zsh &>/dev/null; then
echo "Running zsh rehash..."
zsh -c 'rehash'
else
echo "Skipping pkgfile update (no packages installed)."
fi
# Add other post-install steps here as needed