cleanup
This commit is contained in:
parent
dbcb084283
commit
dd8263eaac
|
@ -6,10 +6,10 @@ RED='\033[1;30m'
|
||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
dotfiles="${1:-$HOME/.dotfiles}"
|
dotfiles="${1:-$HOME/.dotfiles}"
|
||||||
|
|
||||||
echo "${BLUE}Using $dotfiles as dotfiles directory!${NC}"
|
echo "${BLUE}Changing directory to $dotfiles${NC}"
|
||||||
if ! cd "$dotfiles"; then
|
if ! cd "$dotfiles"; then
|
||||||
echo "${RED}Could not CD into $dotfiles${NC}"
|
echo "${RED}Could not CD into $dotfiles${NC}"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ echo "${BLUE}Stashing existing changes...${NC}"
|
||||||
stash_result=$(git stash push -m "sync-dotfiles: Before syncing dotfiles")
|
stash_result=$(git stash push -m "sync-dotfiles: Before syncing dotfiles")
|
||||||
needs_pop=1
|
needs_pop=1
|
||||||
if [ "$stash_result" = "No local changes to save" ]; then
|
if [ "$stash_result" = "No local changes to save" ]; then
|
||||||
needs_pop=0
|
needs_pop=0
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
@ -26,27 +26,23 @@ git pull origin main
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [ $needs_pop -eq 1 ]; then
|
if [ $needs_pop -eq 1 ]; then
|
||||||
echo "${BLUE}Popping stashed changes...${NC}"
|
echo "${BLUE}Popping stashed changes...${NC}"
|
||||||
git stash pop
|
git stash pop
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|
||||||
unmerged_files=$(git diff --name-only --diff-filter=U)
|
unmerged_files=$(git diff --name-only --diff-filter=U)
|
||||||
if [ -n "$unmerged_files" ]; then
|
if [ -n "$unmerged_files" ]; then
|
||||||
echo "${RED}The following files have merge conflicts after popping the stash:${NC}"
|
echo "${RED}The following files have merge conflicts after popping the stash:${NC}"
|
||||||
echo
|
echo
|
||||||
printf %"s\n" "$unmerged_files"
|
printf %"s\n" "$unmerged_files"
|
||||||
else
|
else
|
||||||
stow -t "$HOME" .
|
stow -t "$HOME" .
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${BLUE}Generating librewolf profiles...${NC}"
|
echo "${BLUE}Generating librewolf profiles...${NC}"
|
||||||
if ! cd "$dotfiles/.librewolf"; then
|
envsubst <.librewolf/installs.template >$HOME/.librewolf/installs.ini
|
||||||
"${RED}Could not CD into $HOME/.librewolf${NC}"
|
envsubst <.librewolf/profiles.template >$HOME/.librewolf/profiles.ini
|
||||||
exit
|
|
||||||
fi
|
|
||||||
envsubst < installs.template > $HOME/.librewolf/installs.ini
|
|
||||||
envsubst < profiles.template > $HOME/.librewolf/profiles.ini
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "${GREEN}Dotfiles Synced Successfully!${NC}"
|
echo "${GREEN}Dotfiles Synced Successfully!${NC}"
|
||||||
|
|
Loading…
Reference in New Issue