Skip to content

Commit

Permalink
fix: add lakefile.tom detection to detect_mathlib.sh (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
austinletson authored May 11, 2024
1 parent de5c38a commit 8b3eddb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/detect_mathlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

echo "Trying to detect if project is downstream of Mathlib."

# Check if the lakefile.lean file contains "require mathlib"
if grep -q "require mathlib" lakefile.lean; then
# define mathlib dependency patterns for lakefile.lean and lakefile.toml
dot_lean_pattern="require mathlib"
dot_toml_pattern="\[\[require\]\]\nname = \"mathlib\"\ngit = \"https://github.com/leanprover-community/mathlib4"

# Check if lakefile.lean or lakefile.toml contain the mathlib dependency pattern
if grep -q "$dot_lean_pattern" lakefile.lean || grep -Pzq "$dot_toml_pattern" lakefile.toml; then
# Set the DETECTED_MATHLIB variable to true and send it to the GitHub action output to be used in later steps
echo "DETECTED_MATHLIB=true" >> "$GITHUB_OUTPUT"
echo "Project is downstream of Mathlib. Using Mathlib cache."
else
Expand Down

0 comments on commit 8b3eddb

Please sign in to comment.