Skip to content

Commit

Permalink
Repetition and reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
adomani committed Apr 3, 2024
1 parent f9105d8 commit 49729f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/mkAll.lean
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ def mkAllCLI (args : Parsed) : IO UInt32 := do
| some lib => return #[lib.as! String]
| none => getLeanLibs
let mut updates := 0
for d in libs do
for d in libs.reverse do -- reverse to create `Mathlib.Tactic` before `Mathlib`
let fileName := addExtension d "lean"
let fileContent ← getAll git d
if (! (← pathExists fileName)) || (← IO.FS.readFile fileName) != fileContent then
if !(← pathExists fileName) then
IO.println s!"Updating '{fileName}'"
updates := updates + 1
IO.FS.writeFile fileName fileContent
else if (← IO.FS.readFile fileName) != fileContent then
IO.println s!"Updating '{fileName}'"
updates := updates + 1
IO.FS.writeFile fileName fileContent
Expand Down

0 comments on commit 49729f9

Please sign in to comment.