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

Skip compile when from'gh-r' ice is set unless compile is also set.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This commit is contained in:
vladislav doster 2023-11-20 05:50:12 -06:00 committed by GitHub
parent 8170753a5d
commit 1f52eee1b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -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)
@ -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
}

View file

@ -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]} = \! )