Skip to content

Commit

Permalink
Ensure remote branches are known
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Nov 4, 2023
1 parent 7fe68e9 commit 95fbc01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion addon_meterstoha/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ git clone --depth=1 "https://github.com/mdeweerd/MetersToHA.git" --no-checkout M
cd MetersToHA || exit 255
git sparse-checkout set apps

if [ "$GIT_VERSION_STR" != "" ] ; then
# Make sure we have copy of branches
git remote set-branches origin '*'
git fetch -v --depth=1
fi

# GIT_VERSION_STR is allowed to be empty
echo "git checkout $GIT_VERSION_STR"
# shellcheck disable=SC2086,SC2090
git checkout $GIT_VERSION_STR

echo "MetersToHA Container version: $(bashio::addon.version).008 @$(stat -c '%y' "${MYDIR}run.sh")"
echo "MetersToHA Container version: $(bashio::addon.version).010 @$(stat -c '%y' "${MYDIR}run.sh")"
git show -s --pretty=format:"MetersToHA Python GIT version: %h on %ad%n"
)

Expand Down

0 comments on commit 95fbc01

Please sign in to comment.