update udot (update dot files) function
This commit is contained in:
35
functions
35
functions
@@ -1,12 +1,33 @@
|
|||||||
# Update dotfiles
|
# Update dotfiles
|
||||||
udot() {
|
udot() {
|
||||||
cwd=$(pwd)
|
info=$(git --no-pager log --pretty="%h by %an <%ae> on %cd" -1 --abbrev-commit)
|
||||||
cd ~/.dotfiles/
|
local=$(git --no-pager log --pretty="%H" -1)
|
||||||
git pull
|
remote=$(git ls-remote origin | awk "/HEAD/ {print \$1}")
|
||||||
bin/dfm install
|
echo -e ""
|
||||||
source ~/.dotfiles/aliases
|
echo -e ' ____ U ___ u _____ _____ _ U _____ u ____ '
|
||||||
source ~/.dotfiles/functions
|
echo -e ' | _"\ \/"_ \/|_ " _| |" ___| ___ |"| \| ___"|// __"| u '
|
||||||
cd $cwd
|
echo -e ' /| | | | | | | | | | U| |_ u |_"_| U | | u | _|" <\___ \/ '
|
||||||
|
echo -e ' U| |_| |\.-,_| |_| | /| |\ \| _|/ | | \| |/__ | |___ u___) | '
|
||||||
|
echo -e ' |____/ u \_)-\___/ u |_|U |_| U/| |\u |_____| |_____| |____/>> '
|
||||||
|
echo -e ' |||_ \\ _// \\_ )(\\,-.-,_|___|_,-.// \\ << >> )( (__)'
|
||||||
|
echo -e ' (__)_) (__) (__) (__)(__)(_/ \_)-' '-(_/(_")("_)(__) (__)(__) '
|
||||||
|
echo -e ""
|
||||||
|
echo -e "$info"
|
||||||
|
echo -e ""
|
||||||
|
|
||||||
|
if [ "$local" = "$remote" ]; then
|
||||||
|
echo "Already up to date :)"
|
||||||
|
else
|
||||||
|
echo -e "Updating..."
|
||||||
|
cwd=$(pwd)
|
||||||
|
cd ~/.dotfiles/
|
||||||
|
git pull
|
||||||
|
bin/dfm install
|
||||||
|
source ~/.dotfiles/aliases
|
||||||
|
source ~/.dotfiles/functions
|
||||||
|
cd $cwd
|
||||||
|
fi
|
||||||
|
echo -e ""
|
||||||
}
|
}
|
||||||
|
|
||||||
# will attach to existing tmux session, create new if one does not exist or just start bash if there is no tmux available.
|
# will attach to existing tmux session, create new if one does not exist or just start bash if there is no tmux available.
|
||||||
|
|||||||
Reference in New Issue
Block a user