Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
fix version info
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Hartmann committed Apr 10, 2017
1 parent ec69fa6 commit 588b691
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ get_bash_rc() {

# # # # # # # # # # # # # # # # # # # #
# mac OSX and .bash_profile
elif [ $PC_SYSTEM = 'Darwin' ] && [ -f "$HOME/.bash_profile" ]; then
elif [ $GIST_SYSTEM = 'Darwin' ] && [ -f "$HOME/.bash_profile" ]; then
echo "$HOME/.bash_profile"

# # # # # # # # # # # # # # # # # # # #
# mac OSX and .profile
elif [ $PC_SYSTEM = 'Darwin' ] && [ -f "$HOME/.profile" ]; then
elif [ $GIST_SYSTEM = 'Darwin' ] && [ -f "$HOME/.profile" ]; then
echo "$HOME/.profile"

# # # # # # # # # # # # # # # # # # # #
Expand All @@ -32,7 +32,7 @@ help() {
# spaces until the commands descriptions starts
SPACE=" "

printf " ${BLUE}gist ${BOLD}v${PC_VERSION}-beta${NORMAL}\n"
printf " ${BLUE}gist ${BOLD}v${GIST_VERSION}-beta${NORMAL}\n"
printf "\n"
printf " help: gist [command]\n"
printf "\n"
Expand Down
21 changes: 21 additions & 0 deletions vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,24 @@ GIST_CACHE_DIR=$GIST_DIR/cache
GIST_CACHE_ALL=$GIST_CACHE_DIR/all.json

. functions.sh

# current pro-cli version
GIST_VERSION=$(cd $GIST_DIR && git describe --tags)

if [ -f "$GIST_DIR/.git/FETCH_HEAD" ]; then
GIST_HEAD_FILE="$GIST_DIR/.git/FETCH_HEAD"
else
GIST_HEAD_FILE="$GIST_DIR/.git/HEAD"
fi

GIST_LATEST_FETCH=$(filemtime $GIST_HEAD_FILE)

# check for new version
if [ $GIST_LATEST_FETCH != 0 ] && [ $GIST_LATEST_FETCH -gt 1800 ]; then
# only fetch every 30 minutes
GIST_VERSION_NEW=$(cd $GIST_DIR && git fetch -q && git describe --tags `git rev-list --tags --max-count=1`)
elif [ $GIST_LATEST_FETCH != 0 ]; then
GIST_VERSION_NEW=$(cd $GIST_DIR && git describe --tags `git rev-list --tags --max-count=1`)
fi

GIST_VERSION_SUFFIX="-beta"

0 comments on commit 588b691

Please sign in to comment.