Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto update #44

Open
dnakeys opened this issue May 17, 2024 · 1 comment
Open

auto update #44

dnakeys opened this issue May 17, 2024 · 1 comment

Comments

@dnakeys
Copy link

dnakeys commented May 17, 2024

snagged the idea form the powershell script still trying to figure out pull reqs but I added This to my .bashrc and it has been updating

#inserted at line22

########### 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/ChrisTitusTech/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 #########
JoshuaACasey added a commit to JoshuaACasey/mybash that referenced this issue May 30, 2024
add a self .bashrc updater, courtesy of ChrisTitusTech#44
@AkkhilCodingHub
Copy link

Hello brother already introduced this idea in Winutil ChrisTitusTech/winutil#2016 (comment)
I am thinking to also make a issue in linutil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants