move stuff around

This commit is contained in:
2024-09-08 16:36:19 +02:00
parent 452b0e92e2
commit 81b07991aa
9 changed files with 59 additions and 24 deletions

View File

@ -1,28 +1,32 @@
IGREEN := \033[0;92m
NO_COLOR := \033[0m
help:
@echo "Usage: make [OPTION]"
@echo "Available options are:"
@echo "help"
@echo "install"
@echo "compile"
@echo "install This will also compile"
@echo "uninstall"
compile:
@echo "==> Compiling backup"
@echo -e "$(IGREEN)==> Compiling backup$(NO_COLOR)"
go build .
install: compile
@echo "==> Copying the hooks into /etc/pacman.d/hooks"
@echo -e "$(IGREEN)==> Copying the hooks into /etc/pacman.d/hooks$(NO_COLOR)"
[[ -d /etc/pacman.d/hooks ]] || sudo mkdir /etc/pacman.d/hooks
sudo cp pre_backup.hook post_backup.hook /etc/pacman.d/hooks
@echo "==> Copying backup into /usr/local/bin"
@echo -e "$(IGREEN)==> Copying backup into /usr/local/bin$(NO_COLOR)"
sudo install -Dm755 backup /usr/local/bin/backup
@echo "==> Copying the config into /etc"
@echo -e "$(IGREEN)==> Copying the config into /etc$(NO_COLOR)"
[[ -f /etc/update.toml ]] || sudo cp update.toml /etc
@echo "==> Finished."
@echo -e "$(IGREEN)==> Finished.$(NO_COLOR)"
uninstall:
@echo "==> Removing the hooks from /etc/pacman.d/hooks"
@echo -e "$(IGREEN)==> Removing the hooks from /etc/pacman.d/hooks$(NO_COLOR)"
sudo rm /etc/pacman.d/hooks/pre_backup.hook /etc/pacman.d/hooks/post_backup.hook
@echo "==> Removing backup into /usr/local/bin"
@echo -e "$(IGREEN)==> Removing backup into /usr/local/bin$(NO_COLOR)"
sudo rm /usr/local/bin/backup
@echo "==> /etc/update.toml will remain"
@echo "==> Finished."
@echo -e "$(IGREEN)==> /etc/update.toml will remain$(NO_COLOR)"
@echo -e "$(IGREEN)==> Finished.$(NO_COLOR)"