Closed YannMagnin closed 4 years ago
# Get new tags from the remote
printf "Fetch repo...\n"
git fetch --tags
if [ "$1" == "snapshot" ]
then
latest_tag=$(git rev-list --all --max-count=1)
else
latest_tag=$(git rev-list --tags --max-count=1)
fi
if [ "$latest_tag" != "$current_tag" ]
then
# Get the latest tag name, assign it to a variable
latest_tag_name=$(git describe --tags $latest_tag)
# Checkout the latest tag
git reset --hard > /dev/null
git checkout "$latest_tag" 2> /dev/null
...
Work for me.
git fetch --tags
can fail I guess (eg: network issue), but 5a5291...
is the last commit so why git describe ...
fail ?
Ok git describe --tags $latest_tag
fail because we use git clone --depth 1
in install.sh
, so the git is shallow and don't have new tags/commits.
Using
blih_cli
version0.1.2
When I try to switch to the "snapshot" version of the project using
blih_cli --snapshot
I have this Git error message:And the
blih_cli
version displayed on the next execution is:v0.0.0