Auto Update

This commit is contained in:
matt1432 2023-01-08 10:01:17 -05:00
parent 9785e0d83c
commit 33e3edb6c2
2 changed files with 13 additions and 9 deletions

View file

@ -1,5 +1,3 @@
. ~/.bashrc
if [ -d ~/git/dotfiles ] ; then if [ -d ~/git/dotfiles ] ; then
bash ~/git/dotfiles/pull.sh bash ~/git/dotfiles/pull.sh
rm ~/.bash* ~/.profile rm ~/.bash* ~/.profile
@ -7,3 +5,5 @@ if [ -d ~/git/dotfiles ] ; then
ln ./.bash* ../../ ln ./.bash* ../../
ln ./.profile ../../) ln ./.profile ../../)
fi fi
. ~/.bashrc

16
pull.sh
View file

@ -1,10 +1,14 @@
#!/bin/bash #!/bin/bash
if [ -d ~/git/dotfiles ] ; then if [ -d ~/git/dotfiles ] ; then
(git config --global user.email "matt@nelim.org" && git config --global user.email "matt@nelim.org"
git config --global user.name "matt1432" && git config --global user.name "matt1432"
cd ~/git/dotfiles &&
git config pull.rebase false && (cd ~/git/dotfiles
git pull && git config pull.rebase false
git pull
if [ $(sed 's/.* //' ~/git/dotfiles/.git/FETCH_HEAD) = "git.nelim.org:matt1432/dotfiles" ] ; then
git commit -am "Auto Update" git commit -am "Auto Update"
git push) git push
fi)
fi fi