Skip to content

Commit

Permalink
chore: single install script for cargo-binstall (#5998)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*

This PR just avoids us having multiple ways to install `cargo-binstall`
so everything goes through `cargo-binstall-install.sh`

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
TomAFrench authored Sep 11, 2024
1 parent e20c44d commit 21425de
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .github/scripts/cargo-binstall-install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env bash
set -eu

curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cd $(dirname "$0")

CARGO_BINSTALL_CHECK=$(./command-check.sh cargo-binstall)
if [ $CARGO_BINSTALL_CHECK != "true" ]; then
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
fi
4 changes: 4 additions & 0 deletions .github/scripts/command-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -eu

command -v $1 >/dev/null 2>&1 && echo "true" || { echo >&2 "$1 is not installed" && echo "false"; }
7 changes: 2 additions & 5 deletions compiler/wasm/scripts/install_wasm-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ set -eu

cd $(dirname "$0")/..

# Install wasm-pack
CARGO_BINSTALL_CHECK=$(./scripts/command-check.sh cargo-binstall)
if [ $CARGO_BINSTALL_CHECK != "true" ]; then
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
fi
../../.github/scripts/cargo-binstall-install.sh

# Install wasm-pack
cargo-binstall wasm-pack@0.12.1 -y --force

0 comments on commit 21425de

Please sign in to comment.