Skip to content

Commit

Permalink
Merge pull request #476 from 39e/fix/setup-paths
Browse files Browse the repository at this point in the history
Setup paths after variables have been initialized
  • Loading branch information
b4b4r07 committed May 12, 2018
2 parents 3d6f272 + 238caa2 commit 08c76dc
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions base/core/core.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,6 @@ __zplug::core::core::run_interfaces()

__zplug::core::core::prepare()
{
# Unique array
typeset -gx -U path
typeset -gx -U fpath

# Add to the PATH
path=(
${ZPLUG_ROOT:+"$ZPLUG_ROOT/bin"}
${ZPLUG_BIN:-"$ZPLUG_HOME/bin"}
"$path[@]"
)

# Add to the FPATH
fpath=(
"$ZPLUG_ROOT"/misc/completions(N-/)
"$ZPLUG_ROOT/base/sources"
"$fpath[@]"
)

# Check whether you meet the requirements for using zplug
# 1. zsh 4.3.9 or more
# 2. git
Expand Down Expand Up @@ -144,6 +126,24 @@ __zplug::core::core::prepare()
# Release zplug variables and export
__zplug::core::core::variable || return 1

# Unique array
typeset -gx -U path
typeset -gx -U fpath

# Add to the PATH
path=(
${ZPLUG_ROOT:+"$ZPLUG_ROOT/bin"}
${ZPLUG_BIN:-${ZPLUG_HOME:+"$ZPLUG_HOME/bin"}}
"$path[@]"
)

# Add to the FPATH
fpath=(
"$ZPLUG_ROOT"/misc/completions(N-/)
"$ZPLUG_ROOT/base/sources"
"$fpath[@]"
)

mkdir -p "$ZPLUG_HOME"/{,log}
mkdir -p "$ZPLUG_BIN"
mkdir -p "$ZPLUG_CACHE_DIR"
Expand Down

0 comments on commit 08c76dc

Please sign in to comment.