mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
chore(bootstrap): optimize shell-scripts for robustness
This commit is contained in:
parent
42b83d4696
commit
2c014e281f
13 changed files with 441 additions and 184 deletions
|
|
@ -8,21 +8,21 @@ echo "[ACTION] Press any key to proceed"
|
|||
read -n 1
|
||||
|
||||
if [ "$WHEEL" -eq 1 ]; then
|
||||
echo "[INFO] Setting up system-wide zsh configuration"
|
||||
echo "[ACTION] Elevation required"
|
||||
test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zsh/zshenv"
|
||||
test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zshenv"
|
||||
if [ $(uname) = "Darwin" ]; then
|
||||
sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zshenv"
|
||||
fi
|
||||
echo "[INFO] Setting up system-wide zsh configuration"
|
||||
echo "[ACTION] Elevation required"
|
||||
test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zsh/zshenv"
|
||||
test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zshenv"
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zshenv"
|
||||
fi
|
||||
else
|
||||
echo "[INFO] Setting up user zsh configuration"
|
||||
# A fallback case to set $ZDOTDIR in ~/.zshenv if the user cannot access global zshenv
|
||||
ln -sf "$DOTFILES/tools/zsh/zshenv" "$HOME/.zshenv"
|
||||
echo "[INFO] Setting up user zsh configuration"
|
||||
# A fallback case to set $ZDOTDIR in ~/.zshenv if the user cannot access global zshenv
|
||||
ln -sf "$DOTFILES/tools/zsh/zshenv" "$HOME/.zshenv"
|
||||
fi
|
||||
|
||||
echo "[INFO] Installing zsh plugins"
|
||||
test -d $ZDOTDIR/plugins/zsh-autosuggestions || git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git $ZDOTDIR/plugins/zsh-autosuggestions
|
||||
test -d $ZDOTDIR/plugins/zsh-syntax-highlighting || git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git $ZDOTDIR/plugins/zsh-syntax-highlighting
|
||||
test -d $ZDOTDIR/plugins/zsh-history-substring-search || git clone --depth 1 https://github.com/zsh-users/zsh-history-substring-search.git $ZDOTDIR/plugins/zsh-history-substring-search
|
||||
test -d $ZDOTDIR/plugins/zsh-completions || git clone --depth 1 https://github.com/zsh-users/zsh-completions.git $ZDOTDIR/plugins/zsh-completions
|
||||
test -d "$ZDOTDIR"/plugins/zsh-autosuggestions || git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git "$ZDOTDIR"/plugins/zsh-autosuggestions
|
||||
test -d "$ZDOTDIR"/plugins/zsh-syntax-highlighting || git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZDOTDIR"/plugins/zsh-syntax-highlighting
|
||||
test -d "$ZDOTDIR"/plugins/zsh-history-substring-search || git clone --depth 1 https://github.com/zsh-users/zsh-history-substring-search.git "$ZDOTDIR"/plugins/zsh-history-substring-search
|
||||
test -d "$ZDOTDIR"/plugins/zsh-completions || git clone --depth 1 https://github.com/zsh-users/zsh-completions.git "$ZDOTDIR"/plugins/zsh-completions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue