dotfiles/scripts/aurup.fish

41 lines
965 B
Fish
Executable file

#!/usr/bin/env fish
# Small fish script for updating AUR packages using auracle.
#
# 2020 © Marcel Kapfer <opensource@mmk2410.org>
#
# License: GPLv3 (https://www.gnu.org/licenses/gpl-3.0.en.html)
for pkg in (auracle outdated | cut -d' ' -f1)
set -l pwd $PWG
auracle outdated
if test $status -ne 0
echo "No updates available."
echo "Exiting now..."
exit 1
else
echo "Updating existing repositories..."
cd ~/aur/
echo "Updating $pkg"
auracle update
end
cd $pkg
cat PKGBUILD
read -P 'PKGBUILD OK? (y/N) > ' pkgbuild_ok
if test $pkgbuild_ok != "y"
read -P 'Edit PKGBUKD? (Y/n) > ' pkgbuild_edit
if test $pkgbuild_edit != "n"
$EDITOR -nw PKGBUILD
read -P 'PKGBUILD now OK? (y/N) > ' pkgbuild_edit_ok
if test $pkgbuild_edit_ok != "y"
continue
end
else
continue
end
end
makepkg -Ccsir
cd ..
end
cd $pwd