diff --git a/install b/install index 6b64a3f..5a99930 100755 --- a/install +++ b/install @@ -6,16 +6,21 @@ fzf_base=`pwd` ARCHI=$(uname -sm) download() { + mkdir -p "$fzf_base"/bin + cd "$fzf_base"/bin echo "Downloading fzf executable ($1) ..." - if curl -fLo "$fzf_base"/bin/fzf https://github.com/junegunn/fzf-bin/releases/download/snapshot/$1; then - chmod +x "$fzf_base"/bin/fzf + if curl -fL \ + https://github.com/junegunn/fzf-bin/releases/download/snapshot/${1}.tar.gz | + tar -xz; then + mv $1 fzf + chmod +x fzf else echo "Failed to download $1" exit 1 fi + cd - > /dev/null } -mkdir -p "$fzf_base"/bin if [ "$ARCHI" = "Darwin x86_64" ]; then download fzf_darwin_amd64 elif [ "$ARCHI" = "Linux x86_64" ]; then diff --git a/src/Makefile b/src/Makefile index bae4c90..fecf7d2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -25,7 +25,10 @@ SOURCES = $(wildcard *.go fzf/*.go) all: build -build: $(BINARY) +build: $(BINARY).tar.gz + +$(BINARY).tar.gz: $(BINARY) + cd fzf && tar -czf $(notdir $(BINARY)).tar.gz $(notdir $(BINARY)) $(BINARY): $(SOURCES) go get @@ -37,7 +40,7 @@ install: $(BINARY) cp -f $(BINARY) $(BINDIR)/fzf clean: - rm -f $(BINARY) + rm -f $(BINARY) $(BINARY).tar.gz docker: docker build -t junegunn/ubuntu-sandbox .