Browse Source

Use `=` instaed of `==` (#528)

remotes/origin/add-with-shims
Kitae Kim 3 years ago committed by GitHub
parent
commit
e49bd1f407
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      .ci/install.sh

18
.ci/install.sh

@ -40,7 +40,7 @@ parse_args() {
} }
set_filename() { set_filename() {
if [ "$OS" == "Linux" ]; then if [ "$OS" = "Linux" ]; then
# Based on https://stackoverflow.com/a/45125525 # Based on https://stackoverflow.com/a/45125525
case "$(uname -m)" in case "$(uname -m)" in
arm | armv7*) arm | armv7*)
@ -52,13 +52,13 @@ set_filename() {
*) *)
FILENAME="fnm-linux" FILENAME="fnm-linux"
esac esac
elif [ "$OS" == "Darwin" ] && [ "$FORCE_INSTALL" == "true" ]; then elif [ "$OS" = "Darwin" ] && [ "$FORCE_INSTALL" = "true" ]; then
FILENAME="fnm-macos" FILENAME="fnm-macos"
USE_HOMEBREW="false" USE_HOMEBREW="false"
echo "Downloading the latest fnm binary from GitHub..." echo "Downloading the latest fnm binary from GitHub..."
echo " Pro tip: it's easier to use Homebrew for managing fnm in macOS." echo " Pro tip: it's easier to use Homebrew for managing fnm in macOS."
echo " Remove the \`--force-no-brew\` so it will be easy to upgrade." echo " Remove the \`--force-no-brew\` so it will be easy to upgrade."
elif [ "$OS" == "Darwin" ]; then elif [ "$OS" = "Darwin" ]; then
USE_HOMEBREW="true" USE_HOMEBREW="true"
echo "Downloading fnm using Homebrew..." echo "Downloading fnm using Homebrew..."
else else
@ -69,10 +69,10 @@ set_filename() {
} }
download_fnm() { download_fnm() {
if [ "$USE_HOMEBREW" == "true" ]; then if [ "$USE_HOMEBREW" = "true" ]; then
brew install fnm brew install fnm
else else
if [ "$RELEASE" == "latest" ]; then if [ "$RELEASE" = "latest" ]; then
URL="https://github.com/Schniz/fnm/releases/latest/download/$FILENAME.zip" URL="https://github.com/Schniz/fnm/releases/latest/download/$FILENAME.zip"
else else
URL="https://github.com/Schniz/fnm/releases/download/$RELEASE/$FILENAME.zip" URL="https://github.com/Schniz/fnm/releases/download/$RELEASE/$FILENAME.zip"
@ -148,7 +148,7 @@ ensure_containing_dir_exists() {
setup_shell() { setup_shell() {
CURRENT_SHELL="$(basename "$SHELL")" CURRENT_SHELL="$(basename "$SHELL")"
if [ "$CURRENT_SHELL" == "zsh" ]; then if [ "$CURRENT_SHELL" = "zsh" ]; then
CONF_FILE=${ZDOTDIR:-$HOME}/.zshrc CONF_FILE=${ZDOTDIR:-$HOME}/.zshrc
ensure_containing_dir_exists "$CONF_FILE" ensure_containing_dir_exists "$CONF_FILE"
echo "Installing for Zsh. Appending the following to $CONF_FILE:" echo "Installing for Zsh. Appending the following to $CONF_FILE:"
@ -162,7 +162,7 @@ setup_shell() {
echo 'export PATH='$INSTALL_DIR':$PATH' >>$CONF_FILE echo 'export PATH='$INSTALL_DIR':$PATH' >>$CONF_FILE
echo 'eval "`fnm env`"' >>$CONF_FILE echo 'eval "`fnm env`"' >>$CONF_FILE
elif [ "$CURRENT_SHELL" == "fish" ]; then elif [ "$CURRENT_SHELL" = "fish" ]; then
CONF_FILE=$HOME/.config/fish/conf.d/fnm.fish CONF_FILE=$HOME/.config/fish/conf.d/fnm.fish
ensure_containing_dir_exists "$CONF_FILE" ensure_containing_dir_exists "$CONF_FILE"
echo "Installing for Fish. Appending the following to $CONF_FILE:" echo "Installing for Fish. Appending the following to $CONF_FILE:"
@ -175,8 +175,8 @@ setup_shell() {
echo 'set PATH '"$INSTALL_DIR"' $PATH' >>$CONF_FILE echo 'set PATH '"$INSTALL_DIR"' $PATH' >>$CONF_FILE
echo 'fnm env | source' >>$CONF_FILE echo 'fnm env | source' >>$CONF_FILE
elif [ "$CURRENT_SHELL" == "bash" ]; then elif [ "$CURRENT_SHELL" = "bash" ]; then
if [ "$OS" == "Darwin" ]; then if [ "$OS" = "Darwin" ]; then
CONF_FILE=$HOME/.profile CONF_FILE=$HOME/.profile
else else
CONF_FILE=$HOME/.bashrc CONF_FILE=$HOME/.bashrc

Loading…
Cancel
Save