examples
examples copied to clipboard
example suggestion: avoiding `{} <-` `|> await` boilerplate
We should make an example for this once we figure it out ourselves :p
Example of a problematic case:
{} <- log "Extracting current rust version from rust-toolchain.toml..." |> await
{ stable: currentStable, nightly: currentNightly } <- getCurrentVersionsFromToml |> await
{} <- log "Found versions:\n\t- stable: \(versionToStr currentStable)\n\t- nightly with date: \(dateToStr currentNightly)" |> await
# TODO Task.map to avoid repeated `{} <-`?
{} <- log "Searching for nightly matching stable-\(newRustVersion)..." |> await
newNightly <-
findMatchingNigthly (versionFromStr newRustVersion) currentNightly
|> await
{} <- log "New nightly: nightly-\(dateToStr newNightly)" |> await
TODO can we avoid boiler plate of `{} <-` and `await` here?
{} <-
Path.fromStr "rust-toolchain.toml"
|> updateToml newRustVersion
|> await
{} <-
Path.fromStr "examples/platform-switching/rust-platform/rust-toolchain.toml"
|> updateToml newRustVersion
|> await
{} <-
Path.fromStr "Earthfile"
|> updateEarthFile newRustVersion
|> await