Skip to content

Commit

Permalink
Fix error and warnings in install script
Browse files Browse the repository at this point in the history
- Fixed error on line 139 - "==" was being used, whereas sh expects a "=" (and we do this correctly throughout the rest of the file). See https://www.shellcheck.net/wiki/SC3014 for more.
- Changed the use of backticks to the use of `$()` as specified in https://www.shellcheck.net/wiki/SC2006
- Changed the use of `-a` to `&&` as specified in https://www.shellcheck.net/wiki/SC2166

Closes rustwasm#1159
Closes rustwasm#1217
Closes rustwasm#1283
  • Loading branch information
lucashorward committed Aug 7, 2023
1 parent 7d6501d commit afb63e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/_installer/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ main() {

which rustup > /dev/null 2>&1
need_ok "failed to find Rust installation, is rustup installed?"
local _rustup=`which rustup`
local _rustup=$(which rustup)
local _tardir="wasm-pack-$VERSION-${_arch}"
local _url="$UPDATE_ROOT/${_tardir}.tar.gz"
local _dir="$(mktemp -d 2>/dev/null || ensure mktemp -d -t wasm-pack)"
Expand Down Expand Up @@ -98,7 +98,7 @@ get_architecture() {
set -u


if [ "$_ostype" = Darwin -a "$_cputype" = i386 ]; then
if [ "$_ostype" = Darwin ] && [ "$_cputype" = i386 ]; then
# Darwin `uname -s` lies
if sysctl hw.optional.x86_64 | grep -q ': 1'; then
local _cputype=x86_64
Expand Down Expand Up @@ -136,7 +136,7 @@ get_architecture() {
esac

# See https://github.com/rustwasm/wasm-pack/pull/1088
if [ "$_cputype" == "aarch64" ] && [ "$_ostype" == "apple-darwin" ]; then
if [ "$_cputype" = "aarch64" ] && [ "$_ostype" = "apple-darwin" ]; then
_cputype="x86_64"
fi

Expand Down

0 comments on commit afb63e6

Please sign in to comment.