aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2024-01-18 18:28:35 +0000
committerLouis Pilfold <louis@lpil.uk>2024-01-18 18:28:35 +0000
commit451f7f0b0bbd8e1e187fb00d91dc829cc7347e8a (patch)
tree42f1110b3fda15b86c9e562abc5ddc6370e193a4
parent3bfbe688f5a62e29835c7d3c4f282e7fff57949d (diff)
downloadtour-451f7f0b0bbd8e1e187fb00d91dc829cc7347e8a.tar.gz
tour-451f7f0b0bbd8e1e187fb00d91dc829cc7347e8a.zip
Use local compiler copy
-rw-r--r--.gitignore3
-rw-r--r--README.md14
-rw-r--r--src/tour.gleam4
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")