This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
confirm() { | |
while true; do | |
read -rp "[y/n]: " yn | |
case $yn in | |
[Yy]*) return 0 ;; | |
[Nn]*) return 1 ;; | |
*) echo "Please answer yes or no." ;; | |
esac | |
done | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# oh-my-zsh doesn't allow multiple ZSH_CUSTOM folders, here's a workaround | |
# Source: https://gist.github.com/elanora96/b2424fa9f70d7549fd0590c58949f686 | |
local other_plugins_folders=("/usr/share/zsh/plugins" "$HOME/Projects/zsh-plugins") | |
for dir in "${other_plugins_folders[@]}"; do | |
if [[ -d "$dir" ]]; then | |
for sdir in "$dir"/*; do | |
if [[ -d "$sdir" ]] && [[ ! -e "$ZSH/custom/plugins/$(basename "$sdir")" ]]; then | |
ln -s "$sdir" "$ZSH/custom/plugins" | |
fi |