Skip to content

Commit

Permalink
docs: fix the examples directory in EXAMPLE.md and .gitignore (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishiking authored Feb 26, 2025
1 parent d3c6239 commit 15df525
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ target/
/crates/wasmtime-test
/test.js
/shared
example/package-lock.json
example/hello.component.wasm
examples/hello-world/guest/package-lock.json
examples/hello-world/guest/hello.component.wasm
/build-debug
/build-release
/build-release-weval
Expand Down
4 changes: 2 additions & 2 deletions EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ node componentize.mjs

### Running the Component in Wasmtime

Set up the [Cargo.toml as in the example directory](example/Cargo.toml).
Set up the [Cargo.toml as in the example directory](examples/hello-world/host/Cargo.toml).

Set up [`src/main.rs`](example/src/main.rs) as in the example directory.
Set up [`src/main.rs`](examples/hello-world/host/src/main.rs) as in the example directory.

Building and running the binary should print the result:

Expand Down
Binary file removed examples/hello-world/guest/hello.component.wasm
Binary file not shown.
6 changes: 3 additions & 3 deletions examples/hello-world/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export TEST_BINARY_PATH=$(realpath host)/target/release/wasmtime-test
# Build the JS component if not present
echo -e "[info] expecting component WASM at [$COMPONENT_WASM_PATH]...";
if [ ! -f "$COMPONENT_WASM_PATH" ]; then
cd guest && npm install && npm build
cd guest && npm install && npm run build && cd ..
fi

# Build the Rust embedding test binary if not present
echo -e "[info] expecting test binary at [$COMPONENT_WASM_PATH]...";
echo -e "[info] expecting test binary at [$TEST_BINARY_PATH]...";
if [ ! -f "$TEST_BINARY_PATH" ]; then
cd host && cargo build --release
cd host && cargo build --release && cd ..
fi

# Run the test binary, capturing the output
Expand Down

0 comments on commit 15df525

Please sign in to comment.