Fix unquoted variables in all shell scripts to prevent word splitting
Co-authored-by: andrejusk <7396847+andrejusk@users.noreply.github.com>
This commit is contained in:
@@ -18,14 +18,14 @@ if [ -z "$SKIP_SSH_CONFIG" ]; then
|
||||
ssh_target="${HOME}/.ssh"
|
||||
ssh_key="${ssh_target}/id_${ssh_method}"
|
||||
ssh_pub="${ssh_key}.pub"
|
||||
if [ ! -f $ssh_key ]; then
|
||||
if [ ! -f "$ssh_key" ]; then
|
||||
ssh-keygen \
|
||||
-t $ssh_method \
|
||||
-f $ssh_key \
|
||||
-t "$ssh_method" \
|
||||
-f "$ssh_key" \
|
||||
-C "$(whoami)@$(hostname)-$(date -I)"
|
||||
fi
|
||||
|
||||
cat $ssh_pub
|
||||
cat "$ssh_pub"
|
||||
|
||||
unset ssh_method ssh_target ssh_key ssh_pub
|
||||
else
|
||||
|
||||
@@ -29,7 +29,7 @@ export ZSH_SYNTAX_HIGHLIGHTING="$ZSH_CUSTOM/plugins/zsh-syntax-highlighting"
|
||||
if [ ! -d "$ZSH_SYNTAX_HIGHLIGHTING" ]; then
|
||||
git clone -q \
|
||||
https://github.com/zsh-users/zsh-syntax-highlighting.git \
|
||||
$ZSH_SYNTAX_HIGHLIGHTING
|
||||
"$ZSH_SYNTAX_HIGHLIGHTING"
|
||||
fi
|
||||
|
||||
# install zsh-autosuggestions
|
||||
@@ -37,7 +37,7 @@ export ZSH_AUTOSUGGESTIONS="$ZSH_CUSTOM/plugins/zsh-autosuggestions"
|
||||
if [ ! -d "$ZSH_AUTOSUGGESTIONS" ]; then
|
||||
git clone -q \
|
||||
https://github.com/zsh-users/zsh-autosuggestions.git \
|
||||
$ZSH_AUTOSUGGESTIONS
|
||||
"$ZSH_AUTOSUGGESTIONS"
|
||||
fi
|
||||
|
||||
# change default shell to zsh
|
||||
|
||||
@@ -17,16 +17,16 @@ stow --version
|
||||
|
||||
root_dir=${DOTFILES:-$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")}
|
||||
|
||||
rm -f $HOME/.bash_profile
|
||||
rm -f $HOME/.bashrc
|
||||
rm -f $HOME/.gitconfig
|
||||
rm -f $HOME/.profile
|
||||
rm -f $HOME/.zshrc
|
||||
rm -f $HOME/.p10k.zsh
|
||||
rm -f $HOME/.ssh/config
|
||||
rm -f "$HOME/.bash_profile"
|
||||
rm -f "$HOME/.bashrc"
|
||||
rm -f "$HOME/.gitconfig"
|
||||
rm -f "$HOME/.profile"
|
||||
rm -f "$HOME/.zshrc"
|
||||
rm -f "$HOME/.p10k.zsh"
|
||||
rm -f "$HOME/.ssh/config"
|
||||
|
||||
mkdir -p $HOME/.config
|
||||
mkdir -p $HOME/.ssh
|
||||
mkdir -p "$HOME/.config"
|
||||
mkdir -p "$HOME/.ssh"
|
||||
|
||||
stow --dir="$root_dir/files" --target="$HOME" home
|
||||
stow --dir="$root_dir/files" --target="$HOME/.config" dot-config
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
if ! echo $PATH | grep -q "$PYENV_ROOT"; then
|
||||
if ! echo "$PATH" | grep -q "$PYENV_ROOT"; then
|
||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
fi
|
||||
if ! command -v pyenv &>/dev/null; then
|
||||
@@ -31,7 +31,7 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
if [ ! -d "$virtualenv_path" ]; then
|
||||
git clone \
|
||||
https://github.com/pyenv/pyenv-virtualenv.git \
|
||||
$virtualenv_path
|
||||
"$virtualenv_path"
|
||||
fi
|
||||
unset virtualenv_path
|
||||
fi
|
||||
|
||||
@@ -56,6 +56,6 @@ poetry --version
|
||||
|
||||
POETRY_PLUGIN="$ZSH/custom/plugins/poetry"
|
||||
if [ ! -d "$POETRY_PLUGIN" ]; then
|
||||
mkdir -p $POETRY_PLUGIN
|
||||
poetry completions zsh > $POETRY_PLUGIN/_poetry
|
||||
mkdir -p "$POETRY_PLUGIN"
|
||||
poetry completions zsh > "$POETRY_PLUGIN/_poetry"
|
||||
fi
|
||||
|
||||
@@ -173,9 +173,9 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
path="${dock_order[$i]}"
|
||||
name=$(basename "$path" | sed 's/\.app$//')
|
||||
if [[ $dock_state == *"$name"* ]]; then
|
||||
dockutil --move "${path}" --position $i --no-restart
|
||||
dockutil --move "${path}" --position "$i" --no-restart
|
||||
else
|
||||
dockutil --add "${path}" --position $i --no-restart
|
||||
dockutil --add "${path}" --position "$i" --no-restart
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user