Skip to content

auto update #44

Description

@dnakeys

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 #########

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions