* Colorized uninstall output

* Plugin tool improved
This commit is contained in:
nebirhos 2012-03-25 18:50:09 +02:00
commit 2cf1adb251
3 changed files with 45 additions and 21 deletions

View file

@ -1,19 +0,0 @@
# Load plugin passed as first arg
if [ -n "$1" ]; then
PLUGIN="$ZSH/plugins/$1"
if [ -d $PLUGIN ]; then
fpath=($PLUGIN $fpath)
source $PLUGIN/*.plugin.zsh
autoload -U compinit
compinit -i
echo "$1 enabled!"
else
echo "Plugin '$1' not found!"
return 1
fi
else
echo "Please specify a plugin"
return 1
fi

43
tools/plugin.sh Executable file
View file

@ -0,0 +1,43 @@
#!/bin/zsh -x
function omz_plugin_usage() {
echo "Usage: omz plugin [options] [plugin]"
echo "Enable [plugin] in current session"
echo
echo "Options"
echo " -l List available plugins"
echo " -h Show this help message"
}
while getopts ":lh" Option
do
case $Option in
l )
ls $ZSH/plugins
return ;;
* ) omz_plugin_usage
return 1 ;;
esac
done
if [ -n "$1" ]; then
PLUGIN="$ZSH/plugins/$1"
if [ -d $PLUGIN ]; then
fpath=($PLUGIN $fpath)
source $PLUGIN/*.plugin.zsh
autoload -U compinit
compinit -i
echo "\033[0;32mPlugin $1 enabled"
return
else
echo "\033[1;31mPlugin $1 not found"
return 1
fi
else
omz_plugin_usage;
return 1
fi

4
tools/uninstall.sh Normal file → Executable file
View file

@ -1,7 +1,7 @@
#!/bin/zsh #!/bin/zsh
### Better prompt the user! ### Better prompt the user!
echo -n "Are you sure to completely remove Oh My Zsh?" echo -n "\033[0;33mAre you sure to completely remove Oh My Zsh?\033[0m"
read "a? [type 'yes' to continue] " read "a? [type 'yes' to continue] "
if [[ $a != "yes" ]]; then if [[ $a != "yes" ]]; then
return 0 return 0
@ -26,4 +26,4 @@ else
source /etc/profile source /etc/profile
fi fi
echo "Thanks for trying out Oh My Zsh. It's been uninstalled." echo "Thanks for trying out Oh My Zsh. It's been uninstalled."