From 4956a408ccbc8be6172e056e3f413b2ef6b5c273 Mon Sep 17 00:00:00 2001 From: Dragoljub Djuric Date: Fri, 30 Aug 2024 17:57:31 +0200 Subject: [PATCH] Update build.sh --- rust/basic_bitcoin/src/basic_bitcoin/build.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/rust/basic_bitcoin/src/basic_bitcoin/build.sh b/rust/basic_bitcoin/src/basic_bitcoin/build.sh index d56371662..ed5dfd629 100755 --- a/rust/basic_bitcoin/src/basic_bitcoin/build.sh +++ b/rust/basic_bitcoin/src/basic_bitcoin/build.sh @@ -17,10 +17,19 @@ else cargo build --target $TARGET --release fi -ic-wasm \ - "$SCRIPT_DIR/../../target/$TARGET/release/$CANISTER.wasm" \ - -o "$SCRIPT_DIR/../../target/$TARGET/release/$CANISTER.wasm" \ - metadata candid:service -f "$SCRIPT_DIR/basic_bitcoin.did" -v public +cargo install ic-wasm --version 0.2.0 --root ./ +STATUS=$? + +if [[ "$STATUS" -eq "0" ]]; then + ./ic-wasm \ + "$SCRIPT_DIR/../../target/$TARGET/release/$CANISTER.wasm" \ + -o "$SCRIPT_DIR/../../target/$TARGET/release/$CANISTER.wasm" \ + metadata candid:service -f "$SCRIPT_DIR/basic_bitcoin.did" -v public + true +else + echo Could not install ic-wasm + false +fi popd