homes/common/.config/fish/functions/update-homes.fish

69 lines
1.8 KiB
Fish

#!/usr/bin/env fish
function update-homes
argparse 'h/help' 'g/git' 'd/desktop' 'p/private' 'r/root' 'R/remove' 's/skip-secrets' -- $argv
if set --query _flag_help
echo "Update home's configuration"
echo
echo "You need to have homes and homes-private in your home directory."
echo "This function launch the two scripts to update your conf."
echo
echo " -g --git"
echo " Pull-rebase before launch script"
echo
echo " -d --desktop"
echo " Update desktop part"
echo
echo " -p --private"
echo " Update private part"
echo
echo " -r --root"
echo " Update root part"
echo
echo " -s --skip-secrets"
echo " Skip homes-private part"
echo
echo " -R --remove"
echo " Remove old configuration"
echo
echo " -h --help"
echo " Show this screen"
return
end
pushd ~/homes
if set --query _flag_git
gitpr
end
set -f options ""
if set --query _flag_desktop
set -f options "--desktop"
end
if set --query _flag_remove
set -f options "$options --remove"
end
if set --query _flag_root
set -f options "$options --root"
end
./update-home.fish $options
popd
if not set --query _flag_skip-secrets
pushd ~/homes-private
if set --query _flag_git
gitpr
end
set -f options ""
if set --query _flag_private
set -f options "--private"
end
if set --query _flag_root
set -f options "$options --root"
end
./update-private.fish $options
popd
end
end