dotfiles/.config/shell/bin/upd

21 lines
539 B
Text
Raw Normal View History

#!/bin/bash
if command -v tput > /dev/null; then
GREEN="$(tput setaf 2)"
NC="$(tput sgr0)"
fi
# Check for updates for thing in the REPOS_TO_UPDATE variable
IFS=: read -ra REPOS_TO_UPDATE_ARR <<< "$REPOS_TO_UPDATE:$DOCS_DIR:$HOME/bin"
for REPO in "${REPOS_TO_UPDATE_ARR[@]}"; do
if git -C "$REPO" rev-parse > /dev/null 2>&1; then
echo " ${GREEN}Pulling ${REPO/"$HOME"/"~"}‥${NC}"
git -C "$REPO" pull
fi
done
# check for dotfiles updates
echo
2022-05-15 02:06:50 -07:00
echo " ${GREEN}Checking for dotfiles updates‥${NC}"
2022-05-15 02:09:57 -07:00
dotfiles fetch