Skip to content

Commit

Permalink
Detect binary more flexibly for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
babarot committed Dec 26, 2017
1 parent 565096c commit 57115de
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion base/utils/releases.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 57115de

Please sign in to comment.