Skip to content

Commit

Permalink
feat: Remove git command dependency for getting git hash
Browse files Browse the repository at this point in the history
Signed-off-by: imjoey <majunjiev@gmail.com>
  • Loading branch information
imjoey committed Jan 2, 2021
1 parent 90573d1 commit 791b8f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export ENV=local
pwd=`pwd`

VERSION=$(cat ./api/VERSION)
GITHASH=$(cat ./.githash 2> /dev/null || git log --pretty=format:"%h" -1)
GITHASH=$(cat ./.githash 2> /dev/null || HASH="ref: HEAD"; while [[ $HASH == ref\:* ]]; do HASH="$(cat ".git/$(echo $HASH | cut -d \ -f 2)")"; done; echo ${HASH:0:7})

rm -rf output && mkdir -p output/conf && mkdir -p output/dag-to-lua

Expand Down
2 changes: 1 addition & 1 deletion api/test/shell/cli_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [[ -f ../.githash ]]; then
exit 1
fi
else
GITHASH=$(git log --pretty=format:"%h" -1)
GITHASH=$(HASH="ref: HEAD"; while [[ $HASH == ref\:* ]]; do HASH="$(cat "../.git/$(echo $HASH | cut -d \ -f 2)")"; done; echo ${HASH:0:7})
fi

clean_up() {
Expand Down

0 comments on commit 791b8f9

Please sign in to comment.