1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

Fix minor issues found by shellcheck

jdhao 2019-12-14 13:13:13 +08:00
parent af349450ac
commit a948425aa2

@ -46,13 +46,13 @@ if [[ ! "$PYTHON_INSTALLED" = true ]]; then
# Install conda silently # Install conda silently
if [[ -d $CONDA_DIR ]]; then if [[ -d $CONDA_DIR ]]; then
rm -rf $CONDA_DIR rm -rf "$CONDA_DIR"
fi fi
bash $HOME/packages/$CONDA_NAME -b -p $CONDA_DIR bash "$HOME/packages/$CONDA_NAME" -b -p "$CONDA_DIR"
# Setting up environment variables # Setting up environment variables
if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then
echo "export PATH=$CONDA_DIR/bin:$PATH" >> $HOME/.bash_profile echo "export PATH=$CONDA_DIR/bin:$PATH" >> "$HOME/.bash_profile"
fi fi
fi fi
@ -82,7 +82,7 @@ RIPGREP_LINK="https://github.com/BurntSushi/ripgrep/releases/download/11.0.2/rip
if [[ ! -f $RIPGREP_SRC_NAME ]]; then if [[ ! -f $RIPGREP_SRC_NAME ]]; then
echo "Downloading ripgrep and renaming" echo "Downloading ripgrep and renaming"
wget $RIPGREP_LINK -O $RIPGREP_SRC_NAME wget $RIPGREP_LINK -O "$RIPGREP_SRC_NAME"
fi fi
if [[ ! -d "$RIPGREP_DIR" ]]; then if [[ ! -d "$RIPGREP_DIR" ]]; then
@ -91,10 +91,10 @@ if [[ ! -d "$RIPGREP_DIR" ]]; then
fi fi
echo "Extracting to $HOME/tools/ripgrep directory" echo "Extracting to $HOME/tools/ripgrep directory"
tar zxvf $RIPGREP_SRC_NAME -C $RIPGREP_DIR --strip-components 1 tar zxvf "$RIPGREP_SRC_NAME" -C "$RIPGREP_DIR" --strip-components 1
if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then
echo "export PATH=$RIPGREP_DIR:$PATH" >> $HOME/.bash_profile echo "export PATH=$RIPGREP_DIR:$PATH" >> "$HOME/.bash_profile"
fi fi
####################################################################### #######################################################################
@ -107,16 +107,16 @@ CTAGS_DIR=$HOME/tools/ctags
CTAGS_LINK="https://github.com/universal-ctags/ctags.git" CTAGS_LINK="https://github.com/universal-ctags/ctags.git"
if [[ ! -d $CTAGS_SRC_DIR ]]; then if [[ ! -d $CTAGS_SRC_DIR ]]; then
mkdir -p $CTAGS_SRC_DIR mkdir -p "$CTAGS_SRC_DIR"
fi fi
cd $CTAGS_SRC_DIR cd "$CTAGS_SRC_DIR"
git clone $CTAGS_LINK . git clone $CTAGS_LINK .
./autogen.sh && ./configure --prefix=$CTAGS_DIR ./autogen.sh && ./configure --prefix="$CTAGS_DIR"
make -j$(nproc) && make install make -j && make install
if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then
echo "export PATH=$CTAGS_DIR/bin:$PATH" >> $HOME/.bash_profile echo "export PATH=$CTAGS_DIR/bin:$PATH" >> "$HOME/.bash_profile"
fi fi
####################################################################### #######################################################################
@ -136,18 +136,18 @@ fi
echo "Downloading Neovim" echo "Downloading Neovim"
if [[ ! -f $NVIM_SRC_NAME ]]; then if [[ ! -f $NVIM_SRC_NAME ]]; then
wget $NVIM_LINK -O $NVIM_SRC_NAME wget "$NVIM_LINK" -O "$NVIM_SRC_NAME"
fi fi
echo "Extracting neovim" echo "Extracting neovim"
tar zxvf $NVIM_SRC_NAME --strip-components 1 -C $NVIM_DIR tar zxvf "$NVIM_SRC_NAME" --strip-components 1 -C "$NVIM_DIR"
echo "Setting up config and installing plugins" echo "Setting up config and installing plugins"
git clone https://github.com/jdhao/nvim-config.git $NVIM_CONFIG_DIR \ git clone https://github.com/jdhao/nvim-config.git "$NVIM_CONFIG_DIR" \
&& $NVIM_DIR/bin/nvim +PlugInstall +qall && "$NVIM_DIR/bin/nvim" +PlugInstall +qall
if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then if [[ "$ADD_TO_SYSTEM_PATH" = true ]]; then
echo "export PATH=$NVIM_DIR/bin:$PATH" >> $HOME/.bash_profile echo "export PATH=$NVIM_DIR/bin:$PATH" >> "$HOME/.bash_profile"
fi fi
@ -155,5 +155,6 @@ fi
# Post processing # # Post processing #
####################################################################### #######################################################################
# Let PATH changes take effect # Let PATH changes take effect
source $HOME/.bash_profile # shellcheck source=/dev/null
source "$HOME/.bash_profile"
``` ```