Skip to content

Commit

Permalink
Update .bashrc
Browse files Browse the repository at this point in the history
add a self .bashrc updater, courtesy of ChrisTitusTech#44
  • Loading branch information
JoshuaACasey authored May 30, 2024
1 parent d4193fc commit 59e2136
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,33 @@ elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi



########### automaticaly get bash update from github ###########
# replace CTT with git username
REPO_URL="https://github.com/ChrisTitusTech/mybash.git"
BRANCH="main" #
#
# .bashrc file
BASHRC_FILE="$HOME/.bashrc"

# temp save bash file
TEMP_FILE=$(mktemp)

# grab updated bash
# replace CTT with git username
curl -sSL "https://raw.githubusercontent.com/JoshuaACasey/mybash/main/.bashrc" -o "$TEMP_FILE"

# repalce bash with new
if [ -s "$TEMP_FILE" ]; then
mv -f "$TEMP_FILE" "$BASHRC_FILE" # no confirm before saving
# mv "$TEMP_FILE" "$BASHRC_FILE" # will ask for confrm before saving
echo "updated .bashrc successfully."
else
echo "failed to update .bashrc."
fi
####### end of update #########

#######################################################
# EXPORTS
#######################################################
Expand Down

0 comments on commit 59e2136

Please sign in to comment.