add download binary option
This commit is contained in:
parent
1e838f4819
commit
ecc7b2e6ff
|
@ -46,9 +46,28 @@ function install_from_source() {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function download_binary() {
|
||||||
|
mkdir -p $CURRENT_DIR/bin
|
||||||
|
# TODO check architecture
|
||||||
|
|
||||||
|
echo "Getting latest release..."
|
||||||
|
|
||||||
|
# TODO use "latest" tag
|
||||||
|
url=$(curl -s "https://api.github.com/repos/morantron/tmux-fingers/releases" | grep browser_download_url | tail -1 | grep -o https://.*x86_64)
|
||||||
|
|
||||||
|
|
||||||
|
echo "Downloading binary from $url"
|
||||||
|
|
||||||
|
# download binary to bin/tmux-fingers
|
||||||
|
curl -L $url -o $CURRENT_DIR/bin/tmux-fingers
|
||||||
|
chmod a+x $CURRENT_DIR/bin/tmux-fingers
|
||||||
|
|
||||||
|
echo "Download complete!"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
if [[ "$1" == "download-binary" ]]; then
|
if [[ "$1" == "download-binary" ]]; then
|
||||||
echo "Downloading binary..."
|
download_binary
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$1" == "install-with-brew" ]]; then
|
if [[ "$1" == "install-with-brew" ]]; then
|
||||||
|
|
Loading…
Reference in New Issue