Compare commits
2 Commits
e00c59e066
...
89c2d21b8d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89c2d21b8d | ||
|
|
03ccc8a36d |
16
ZshPlug.zsh
16
ZshPlug.zsh
|
|
@ -54,12 +54,13 @@ fi
|
||||||
## Load custom Plugin directory
|
## Load custom Plugin directory
|
||||||
## Otherwise use default location
|
## Otherwise use default location
|
||||||
export pluginDir=${ZSH_PLUG_pluginDir:-$HOME/.local/share/zsh}
|
export pluginDir=${ZSH_PLUG_pluginDir:-$HOME/.local/share/zsh}
|
||||||
export plugins=${ZSH_PLUG_plugins}
|
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# FUNCTION DEFINITIONS #
|
# FUNCTION DEFINITIONS #
|
||||||
########################
|
########################
|
||||||
|
|
||||||
|
export githubPrefix="https://github.com/"
|
||||||
|
|
||||||
ZSH_PLUG_pluginTest() {
|
ZSH_PLUG_pluginTest() {
|
||||||
## Test if a plugin is installed or not
|
## Test if a plugin is installed or not
|
||||||
## RETURNS
|
## RETURNS
|
||||||
|
|
@ -121,23 +122,24 @@ Plug() {
|
||||||
# test for git as needed to get plugins
|
# test for git as needed to get plugins
|
||||||
command -v git > /dev/null || { echo "Git is not installed" >&2 ; return 1; }
|
command -v git > /dev/null || { echo "Git is not installed" >&2 ; return 1; }
|
||||||
|
|
||||||
## No need to check if plugins has content since if there are no plugins this does not run anything
|
## No need to check if plugins has content since if there are no plugins this does not run anythinh
|
||||||
for Plugin in $ZSH_PLUG_Plugins; do
|
|
||||||
|
for Plugin in ${ZSH_PLUG_plugins[@]}; do
|
||||||
echo "$Plugin"
|
echo "$Plugin"
|
||||||
pluginTest "$Plugin"
|
ZSH_PLUG_pluginTest "$Plugin"
|
||||||
local exitcode="$?"
|
local exitcode="$?"
|
||||||
case $exitcode in
|
case $exitcode in
|
||||||
0)
|
0)
|
||||||
## plugin installed
|
## plugin installed
|
||||||
echo "Loading $Plugin"
|
echo "Loading $Plugin"
|
||||||
pluginLoad "$Plugin"
|
ZSH_PLUG_pluginLoad "$Plugin"
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
## plugin not installed
|
## plugin not installed
|
||||||
echo "Installing $Plugin"
|
echo "Installing $Plugin"
|
||||||
pluginInstall "$Plugin"
|
ZSH_PLUG_pluginInstall "$Plugin"
|
||||||
echo "Loading $Plugin"
|
echo "Loading $Plugin"
|
||||||
pluginLoad "$Plugin"
|
ZSH_PLUG_pluginLoad "$Plugin"
|
||||||
;;
|
;;
|
||||||
4)
|
4)
|
||||||
## Too many args to pluginTest
|
## Too many args to pluginTest
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user