Move the last-git txt file to ~/.config to make the script agnostic of where it is run from

This commit is contained in:
2024-03-14 20:39:57 -05:00
parent dfdc331ec2
commit 5f998fc5f8

View File

@@ -31,12 +31,12 @@ sudo flatpak update
#Check if its been more than two weeks since the last rebuild of AUR -git packages
if [ ! -f ./last-git.txt ]; then
if [ ! -f $HOME/.config/ArchUpdater/last-git.txt ]; then
echo "It looks like this is the first time you have run this script or you have said no to this question before. AUR -git packages should occasionally be rebuilt as generally they will build from the most current HEAD of the git project but the maintainer may not update the AUR package as frequently, to get the latest version it is recommended to run yay -S <pkgname> every now and then. Would you like this script to do so now? In the future you will only be prompted to do this if it has been more than 2 weeks since the previous run, as AUR packages are often built from source it can be time consuming"
while true; do
read -p "Would you like to update your -git aur packages? (y/n) " yn
case $yn in
[Yy]* ) yay -S $gitlist; echo $(date +%s) > ./last-git.txt; break;;
[Yy]* ) yay -S $gitlist; echo $(date +%s) > $HOME/.config/ArchUpdater/last-git.txt; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
@@ -46,7 +46,7 @@ elif [ $(($(date +%s)-$(<last-git.txt))) -gt 1209600 ]; then
while true; do
read -p "Would you like to do so now? (y/n) " yn
case $yn in
[Yy]* ) yay -S $gitlist; echo $(date +%s) > ./last-git.txt; break;;
[Yy]* ) yay -S $gitlist; echo $(date +%s) > $HOME/.config/ArchUpdater/last-git.txt; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac