From 451f7f0b0bbd8e1e187fb00d91dc829cc7347e8a Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Thu, 18 Jan 2024 18:28:35 +0000 Subject: Use local compiler copy --- .gitignore | 3 ++- README.md | 14 ++++++++++++++ src/tour.gleam | 4 ++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e472833..7575437 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ *.ez build erl_crash.dump -public +/public +/wasm-compiler diff --git a/README.md b/README.md index ce1a26e..96b97dc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ # The Gleam Language Tour An interactive tour of the Gleam programming language. + +```sh +# Download a wasm version of the Gleam compiler +rm -rf wasm-compiler +mkdir wasm-compiler +cd wasm-compiler +curl -L "https://github.com/gleam-lang/gleam/releases/download/v0.34.1/gleam-v0.34.1-browser.tar.gz" | tar xz +cd .. + +# Build the site +gleam run + +# It's now all the in `public/` directory +``` diff --git a/src/tour.gleam b/src/tour.gleam index 5738bcf..e34cf77 100644 --- a/src/tour.gleam +++ b/src/tour.gleam @@ -22,7 +22,7 @@ const stdlib_sources = "build/packages/gleam_stdlib/src/gleam" const stdlib_external = "build/packages/gleam_stdlib/src" -const compiler_wasm = "../gleam/compiler-wasm/pkg" +const compiler_wasm = "./wasm-compiler" const content_path = "src/content" @@ -333,7 +333,7 @@ fn add_prev_next_for_chapter( fn copy_wasm_compiler() -> snag.Result(Nil) { use <- require( simplifile.is_directory(compiler_wasm), - "compiler-wasm/pkg must have been compiled", + "compiler-wasm must have been compiled", ) simplifile.copy_directory(compiler_wasm, public <> "/compiler") -- cgit v1.2.3