Skip to content

Commit

Permalink
🐛 misc(upgrade-deps): improve version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo committed Dec 2, 2024
1 parent 69713c9 commit 0688628
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions scripts/upgrade-deps
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,23 @@ get_latest_version_github() {
}

get_local_mermaid_version() {
sed -n 's/.*bpt="\([^"]*\)".*/\1/p' "$MERMAID_PATH" | head -n 1
local version
version=$(grep -o '[A-Za-z]\+t="[0-9]\+\.[0-9]\+\.[0-9]\+"' "$MERMAID_PATH" | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' || true)
if [ -z "$version" ]; then
exit_with_message "Could not detect local Mermaid.js version"
fi
echo "$version"
}


get_local_katex_version() {
sed -n 's/.*version:"\([^"]*\)".*/\1/p' "$KATEX_JS_PATH" | head -n 1
local version
version=$(sed -n 's/.*version:"\([^"]*\)".*/\1/p' "$KATEX_JS_PATH" | head -n 1)
if [ -z "$version" ]; then
echo "Could not detect local KaTeX version" >&2
return 1
fi
echo "$version"
}

compare_md5() {
Expand Down

0 comments on commit 0688628

Please sign in to comment.