diff --git a/cli/build.rs b/cli/build.rs index 983c5f95..deba4381 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -17,20 +17,13 @@ fn main() { ); } -fn required_files() -> Vec<&'static Path> { - return vec![ - Path::new("../lib/binding_web/tree-sitter.js"), - Path::new("../lib/binding_web/tree-sitter.wasm") - ]; -} - fn wasm_files_present() -> bool { - for path in required_files() { - if !path.exists() { - return false - } - } - return true + let paths = [ + "../lib/binding_web/tree-sitter.js", + "../lib/binding_web/tree-sitter.wasm", + ]; + + return paths.iter().all(|p| Path::new(p).exists()) } fn read_git_sha() -> Option { diff --git a/docs/section-6-contributing.md b/docs/section-6-contributing.md index 690f38f6..4ccaddea 100644 --- a/docs/section-6-contributing.md +++ b/docs/section-6-contributing.md @@ -29,7 +29,7 @@ git clone https://github.com/tree-sitter/tree-sitter cd tree-sitter ``` -To use the `web-ui` command, you'll need to build the WASM library. If you have emscripten installed, this will use your `emcc` compiler. Otherwise, it will use Docker: +Optionally, build the WASM library. If you skip this step, then the `tree-sitter web-ui` command will require an internet connection. If you have emscripten installed, this will use your `emcc` compiler. Otherwise, it will use Docker: ```sh ./script/build-wasm