mirror of
https://github.com/zplug/zplug
synced 2024-05-21 15:06:12 +02:00
Detect binary more flexibly for releases
This commit is contained in:
parent
8e61577a64
commit
7646b2fbc7
|
@ -212,12 +212,19 @@ __zplug::utils::releases::index()
|
|||
esac
|
||||
|
||||
# TODO: more strictly
|
||||
binaries=(**/*(N-*))
|
||||
binaries=()
|
||||
binaries+=(**/*$cmd*(N-.)) # contains $cmd name files
|
||||
binaries+=(**/*(N-*)) # contains executable files
|
||||
binaries+=( $(file **/*(N-.) | awk -F: '$2 ~ /executable/{print $1}') )
|
||||
if (( $#binaries == 0 )); then
|
||||
# Failed to grab binaries from GitHub Releases"
|
||||
# TODO: logging
|
||||
return 1
|
||||
fi
|
||||
# For debug
|
||||
if (( $#binaries > 1 )); then
|
||||
__zplug::io::print::die "$cmd: Found ${(qqqj:,:)binaries[@]} in $repo\n"
|
||||
fi
|
||||
|
||||
mv -f "$binaries[1]" "$cmd"
|
||||
chmod 755 "$cmd"
|
||||
|
|
Loading…
Reference in New Issue