Skip to content

Commit

Permalink
Update check-material-insiders-version.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
dmundra authored Sep 1, 2024
1 parent 8190df7 commit 9143ca9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .config/mkdocs/check-material-insiders-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ material_insiders_repo="https://github.com/squidfunk/mkdocs-material-insiders.gi

# Get latest tag from material-insiders git repo.
# Got solution from https://stackoverflow.com/questions/29780641/how-to-clone-latest-tag-in-a-git-repo.
latest_tag=$(git ls-remote --verbose --tags --exit-code --refs "$material_insiders_repo" \
latest_tag=$(git ls-remote --tags --exit-code --refs "${material_insiders_repo}" \
| sed -E 's/^[[:xdigit:]]+[[:space:]]+refs\/tags\/(.+)/\1/g' \
| sort --version-sort | tail -n1)

Expand All @@ -44,8 +44,8 @@ installed_tag=$(poetry -C .config/mkdocs/ show mkdocs-material | awk '/version/

# Compare tags
if [ "$latest_tag" = "$installed_tag" ]; then
echo "Latest material-insiders version $latest_tag already installed."
echo "Latest material-insiders version ${latest_tag} already installed."
else
echo "Newer material-insiders version available: $latest_tag. Installing..."
poetry -C .config/mkdocs/ add git+$material_insiders_repo#"$latest_tag"
echo "Newer material-insiders version available: ${latest_tag}. Installing..."
poetry -C .config/mkdocs/ add git+${material_insiders_repo}#"${latest_tag}"
fi

0 comments on commit 9143ca9

Please sign in to comment.