better updater

This commit is contained in:
Anthony Cicchetti 2024-04-16 15:05:15 -04:00
parent cbb978568b
commit e5df0b93cc
3 changed files with 12 additions and 5 deletions

View file

@ -84,6 +84,7 @@
}; };
splitjoin.enable = true; splitjoin.enable = true;
surround.enable = true; surround.enable = true;
tabline.enable = true;
}; };
nvim-cmp = { nvim-cmp = {
enable = true; enable = true;

View file

@ -1,10 +1,16 @@
#!/bin/bash #!/bin/bash
do_devenv() { do_devenv() {
pushd ~/.dotfiles || return pushd ~/.dotfiles || return
printf "Updating \033[38;5;87mdevenv\033[0m \n" printf "Updating \033[38;5;87mdevenv\033[0m \n"
nix flake update nix flake update
popd || return popd || return
} }
do_topgrade() {
topgrade
}
update_home_manager() { update_home_manager() {
pushd ./home-manager || return pushd ./home-manager || return
printf "Updating \033[38;5;87mhome-manager\033[0m\n" printf "Updating \033[38;5;87mhome-manager\033[0m\n"
@ -21,7 +27,7 @@ apply_home_manager() {
popd || return popd || return
} }
while getopts ':dha' opt; do while getopts ':dhat' opt; do
case $opt in case $opt in
a) a)
apply_home_manager apply_home_manager
@ -33,8 +39,11 @@ while getopts ':dha' opt; do
update_home_manager update_home_manager
apply_home_manager apply_home_manager
;; ;;
t)
do_topgrade
;;
?) ?)
echo "Ignoring unknown option. Please only pass -a, -d, or -h" echo "Ignoring unknown option. Please only pass -a, -d, -h, or -t"
exit exit
;; ;;
esac esac

View file

@ -1,8 +1,5 @@
function update_me { function update_me {
pushd ~ pushd ~
if [[ ! ( "$@" =~ -n ) ]]; then
topgrade
fi
pushd ~/.dotfiles/nix pushd ~/.dotfiles/nix
./update.sh $@ ./update.sh $@
popd popd