Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zdharma-continuum/zinit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d55b3a6d50abd6c7568e24b0fc684c161fc08850
Choose a base ref
..
head repository: zdharma-continuum/zinit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2a867374b7f603145875f2cc001263071f4b5687
Choose a head ref
Showing with 15 additions and 18 deletions.
  1. +15 −18 tests/_support/bootstrap
33 changes: 15 additions & 18 deletions tests/_support/bootstrap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env zsh

# Log functions [[[
function error(){ print -P "%F{red}ZUNIT[ERROR]: $1%f" && exit 1; }
function error(){ print -P "%F{red}ZUNIT[ERROR]: $1%f" && return 1; }
function info() { print -P "%F{blue}ZUNIT[INFO]%f: %F{cyan}$1%f"; }
function warn() { print -P "%F{yellow}ZUNIT[WARN]: $1%f"; }
# ]]]
@@ -13,37 +13,34 @@ ZINIT[COMPLETIONS_DIR]=$ZINIT[HOME_DIR]/completions; ZINIT[SNIPPETS_DIR]=$ZINIT[
ZINIT[ZCOMPDUMP_PATH]=$ZINIT[HOME_DIR]/zcompdump; ZINIT[PLUGINS_DIR]=$ZINIT[HOME_DIR]/plugins;
ZPFX=$ZINIT[HOME_DIR]/polaris;

info 'cleaning zinit test environment'
rm -rf $ZINIT[HOME_DIR] || error 'failed to clean test environment'

info 'creating up zinit test environment' \
&& mkdir -p $ZINIT[HOME_DIR] \
&& git -C $GIT_REPO diff > $ZINIT[HOME_DIR]/unstaged.diff \
rm -rf $ZINIT[HOME_DIR]
mkdir -p $ZINIT[HOME_DIR]
git diff > $ZINIT[HOME_DIR]/unstaged.diff
info 'creating test env' \
&& git clone \
--dissociate \
--local \
--no-hardlinks \
--reference "$GIT_REPO" \
"$GIT_REPO" \
"$GIT_REPO"/tests/_support/zunit/zinit.git \
&& [[ -s $ZINIT[HOME_DIR]/unstaged.diff ]] \
"$GIT_REPO"/tests/_support/zunit/zinit.git \
|| error 'failed to create zinit copy for test env' \
&& [[ -s $ZINIT[HOME_DIR]/unstaged.diff ]] \
&& git -C $ZINIT[BIN_DIR] apply $ZINIT[HOME_DIR]/unstaged.diff \
&& info 'installing zinit' \
&& command chmod g-rwX $ZINIT[HOME_DIR] \
&& zcompile $ZINIT[BIN_DIR]/zinit.zsh \
&& info 'successfully initialized zunit env' \
|| error 'failed to create zinit test environment'
&& info 'successfully created zunit env' \
|| err 'failed to create zunit env'

info 'initializing zinit test environment' \
&& source $ZINIT[BIN_DIR]/zinit.zsh \
source $ZINIT[BIN_DIR]/zinit.zsh \
&& autoload -Uz _zinit \
&& (( ${+_comps} )) \
&& _comps[zinit]=_zinit \
|| error 'failed to initialize zinit test environment'
&& _comps[zinit]=_zinit
# ]]]
# Install Annexes [[[
info 'installing zinit test dependencies'
zinit for zdharma-continuum/zinit-annex-{'bin-gem-node','default-ice'}
info "exit code: $?"
info 'installing test dependencies'
zinit light-mode for zdharma-continuum/zinit-annex-{'bin-gem-node','default-ice'}
# ]]]

# vim:ft=zsh:sw=2:sts=2:et:foldmarker=[[[,]]]:foldmethod=marker