On Arch Linux the rustup package can be installed globally, but that doesn't mean that wasm-pack should also do so. /usr/bin/ is basically for packages only, and manually installed binaries should at least go /usr/local/bin.
Instead, we should always try to install to the Cargo binary directory when rustup is detected.
@ishitatsuyuki - so if i am understanding correctly this is a feature request for the installer, yes? (the other way to install wasm-pack is to install it via cargo install, which is something we don't have control of here). if you can specify the exact behavior you'd want and how'd you'd accomplish it in more detail here, we can evaluate and see if it's a good fit to implement! in general- i think it sounds like a good idea! thanks :)
It's more like a bug - the detection algorithm results in unwanted behavior.
The wanted behavior is to align the directory detection with cargo install, not by detecting rustup.
@ashleygwilliams This is DEFINITELY a bug. For me, the init.sh script fails because the default user doesn't have write access to /usr/bin. To make it work, I have to download it and execute it with sudo!
This is 100% a bug. There should also be a way to override the default dir.
I used the following command to install wasm-pack:
$ cargo install wasm-pack
No need for the installer script. The binary is installed into ~/.cargo/bin under archlinux.
Maybe the installation manual could be updated to reflect this option?