mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
* Colorized uninstall output
* Plugin tool improved
This commit is contained in:
parent
d4ea17111e
commit
2cf1adb251
3 changed files with 45 additions and 21 deletions
|
|
@ -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
43
tools/plugin.sh
Executable 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
|
||||||
2
tools/uninstall.sh
Normal file → Executable file
2
tools/uninstall.sh
Normal file → Executable 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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue