-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change
postUpdate?
config to a decl
- Loading branch information
1 parent
5e0f604
commit 819b5ea
Showing
9 changed files
with
114 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
import Lake | ||
open Lake DSL | ||
|
||
package dep where | ||
postUpdate? := some do | ||
let some pkg ← findPackage? `dep | ||
| error "dep is missing from workspace" | ||
let wsToolchainFile := (← getRootPackage).dir / "toolchain" | ||
let depToolchain ← IO.FS.readFile <| pkg.dir / "toolchain" | ||
IO.FS.writeFile wsToolchainFile depToolchain | ||
let some exe := pkg.findLeanExe? `hello | ||
| error s!"{pkg.name}: hello is missing from the package" | ||
let exeFile ← runBuild (exe.build >>= (·.await)) | ||
let exitCode ← env exeFile.toString #["get"] | ||
if exitCode ≠ 0 then | ||
error s!"{pkg.name}: failed to fetch hello" | ||
package dep | ||
|
||
lean_exe hello | ||
|
||
post_update pkg do | ||
let wsToolchainFile := (← getRootPackage).dir / "toolchain" | ||
let depToolchain ← IO.FS.readFile <| pkg.dir / "toolchain" | ||
IO.FS.writeFile wsToolchainFile depToolchain | ||
let exeFile ← runBuild hello.build >>= (·.await) | ||
let exitCode ← env exeFile.toString #["get"] | ||
if exitCode ≠ 0 then | ||
error s!"{pkg.name}: failed to fetch hello" |