Skip to content

Commit

Permalink
Merge pull request #716 from wasmerio/fix/install-script-portability
Browse files Browse the repository at this point in the history
Update install script to use the more potable `=` instead of `==`
  • Loading branch information
syrusakbary authored Aug 23, 2019
2 parents 84588e1 + c0e6f3b commit 854b201
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ wasmer_download_file() {

# echo "Fetching $url.."
if test -x "$(command -v curl)"; then
if [ "$WASMER_INSTALL_LOG" == "$WASMER_VERBOSE" ]; then
if [ "$WASMER_INSTALL_LOG" = "$WASMER_VERBOSE" ]; then
code=$(curl --progress-bar -w '%{http_code}' -L "$url" -o "$destination")
printf "\033[K\n\033[1A"
else
code=$(curl -s -w '%{http_code}' -L "$url" -o "$destination")
fi
elif test -x "$(command -v wget)"; then
if [ "$WASMER_INSTALL_LOG" == "$WASMER_VERBOSE" ]; then
if [ "$WASMER_INSTALL_LOG" = "$WASMER_VERBOSE" ]; then
code=$(wget --show-progress --progress=bar:force:noscroll -q -O "$destination" --server-response "$url" 2>&1 | awk '/^ HTTP/{print $2}' | tail -1)
printf "\033[K\n\033[1A";
else
Expand All @@ -89,7 +89,7 @@ wasmer_download_file() {
exit 1
fi

if [ "$code" == 404 ]; then
if [ "$code" = 404 ]; then
printf "$red> Your architecture is not yet supported ($OS-$ARCH).$reset\n"
echo "> Please open an issue on the project if you would like to use wasmer in your project: https://github.com/wasmerio/wasmer"
exit 1
Expand Down Expand Up @@ -160,14 +160,14 @@ wasmer_link() {
command printf "${SOURCE_STR}"
else
if ! grep -q 'wasmer.sh' "$WASMER_PROFILE"; then
# if [[ $WASMER_PROFILE == *"fish"* ]]; then
# if [[ $WASMER_PROFILE = *"fish"* ]]; then
# command fish -c 'set -U fish_user_paths $fish_user_paths ~/.wasmer/bin'
# else
command printf "$LOAD_STR" >> "$WASMER_PROFILE"
# fi
fi
printf "\033[1A$cyan> Adding to bash profile... ✓$reset\n"
if [ "$WASMER_INSTALL_LOG" == "$WASMER_VERBOSE" ]; then
if [ "$WASMER_INSTALL_LOG" = "$WASMER_VERBOSE" ]; then
printf "${dim}Note: We've added the following to your $WASMER_PROFILE\n"
echo "If you have a different profile please add the following:"
printf "$LOAD_STR$reset\n"
Expand All @@ -179,7 +179,7 @@ wasmer_link() {
)

printf "$green> Successfully installed $version!\n"
if [ "$WASMER_INSTALL_LOG" == "$WASMER_VERBOSE" ]; then
if [ "$WASMER_INSTALL_LOG" = "$WASMER_VERBOSE" ]; then
printf "${reset}${dim}wasmer & wapm will be available the next time you open the terminal.\n"
printf "${reset}${dim}If you want to have the commands available now please execute:\n${reset}source $INSTALL_DIRECTORY/wasmer.sh$reset\n"
fi
Expand Down Expand Up @@ -255,7 +255,7 @@ wasmer_install() {
printf "${reset}Updating Wasmer and WAPM$reset\n"
else
printf "${reset}Installing Wasmer and WAPM!$reset\n"
if [ "$WASMER_INSTALL_LOG" == "$WASMER_VERBOSE" ]; then
if [ "$WASMER_INSTALL_LOG" = "$WASMER_VERBOSE" ]; then
printf "
${magenta1} ww
${magenta1} wwwww
Expand Down Expand Up @@ -328,7 +328,7 @@ wasmer_reset() {
# Example taken from
# https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
# wasmer_compareversions () {
# if [[ $1 == $2 ]]
# if [[ $1 = $2 ]]
# then
# echo "="
# return 0
Expand Down

0 comments on commit 854b201

Please sign in to comment.