Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: from'gh-r' skips compile by default #590

Merged
merged 4 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/zsdoc/zinit-install.zsh.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ ____

____

Has 83 line(s). Calls functions:
Has 87 line(s). Calls functions:

.zinit-compile-plugin
|-- zinit-side.zsh/.zinit-compute-ice
Expand Down
4 changes: 2 additions & 2 deletions tests/gh-r.zunit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
HOME="$ZPFX" # Stops programs creating directories in user home
export ZBIN="${ZPFX}/bin"
export os_type="${OSTYPE//[0-9\.]*/}"
zinit default-ice --quiet from'gh-r' nocompile lbin''
zinit default-ice --quiet from'gh-r' lbin
}

# @test 'atmos' { Universal Tool for DevOps and Cloud Automation (works with terraform, helm, helmfile, etc)
Expand Down Expand Up @@ -723,7 +723,7 @@
run "$s" --version; assert $state equals 0
}
@test 'sd' { # Intuitive find & replace CLI a.k.a modern sed
run zinit lbin'!sd* -> sd' for @chmln/sd; assert $state equals 0
run zinit for @chmln/sd; assert $state equals 0
local sd="$ZBIN/sd"; assert "$sd" is_executable
run "$sd" --version; assert $state equals 0
}
Expand Down
6 changes: 6 additions & 0 deletions zinit-install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,12 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
.zinit-compute-ice "$id_as" "pack" \
ICE plugin_dir filename is_snippet || return 1

# when from"gh-r" ice set, skip compile unless compile ice is set
if [[ ${ICE[from]} = gh-r ]] && (( ${+ICE[compile]} == 0 )); then
+zi-log '{d} from"gh-r" detected, skipping compile'
return 0
fi

if [[ ${ICE[pick]} != /dev/null && ${ICE[as]} != null && \
${+ICE[null]} -eq 0 && ${ICE[as]} != command && ${+ICE[binary]} -eq 0 && \
( ${+ICE[nocompile]} = 0 || ${ICE[nocompile]} = \! )
Expand Down