Skip to content

Commit

Permalink
posh-update updates to current branch if no arg passed
Browse files Browse the repository at this point in the history
  • Loading branch information
riskydissonance committed Oct 13, 2020
1 parent 8439f79 commit c4bfed9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resources/scripts/posh-update
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ OPTIND=1 # Reset in case getopts has been used previously in the shell.

# Initialize our own variables:
GIT_BRANCH="master"
MANUAL_BRANCH_SET=false

show_help(){
echo "*** PoshC2 Update Script ***"
Expand All @@ -29,17 +30,24 @@ while getopts "h?b:" opt; do
exit 0
;;
b) GIT_BRANCH="$OPTARG"
MANUAL_BRANCH_SET=true
;;
esac
done



source /usr/local/bin/_posh-common
get_posh_dir

pushd $POSH_DIR >/dev/null

if [ "$?" -eq "0" ]; then

if [ "$MANUAL_BRANCH_SET" == "false" ]; then
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`
fi

echo ""
echo -e """\033[92m
__________ .__. _________ ________
Expand Down

0 comments on commit c4bfed9

Please sign in to comment.