Update install script to download tarball
This commit is contained in:
parent
40d0a6347c
commit
9930a1d4d9
11
install
11
install
@ -6,16 +6,21 @@ fzf_base=`pwd`
|
|||||||
ARCHI=$(uname -sm)
|
ARCHI=$(uname -sm)
|
||||||
|
|
||||||
download() {
|
download() {
|
||||||
|
mkdir -p "$fzf_base"/bin
|
||||||
|
cd "$fzf_base"/bin
|
||||||
echo "Downloading fzf executable ($1) ..."
|
echo "Downloading fzf executable ($1) ..."
|
||||||
if curl -fLo "$fzf_base"/bin/fzf https://github.com/junegunn/fzf-bin/releases/download/snapshot/$1; then
|
if curl -fL \
|
||||||
chmod +x "$fzf_base"/bin/fzf
|
https://github.com/junegunn/fzf-bin/releases/download/snapshot/${1}.tar.gz |
|
||||||
|
tar -xz; then
|
||||||
|
mv $1 fzf
|
||||||
|
chmod +x fzf
|
||||||
else
|
else
|
||||||
echo "Failed to download $1"
|
echo "Failed to download $1"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
cd - > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir -p "$fzf_base"/bin
|
|
||||||
if [ "$ARCHI" = "Darwin x86_64" ]; then
|
if [ "$ARCHI" = "Darwin x86_64" ]; then
|
||||||
download fzf_darwin_amd64
|
download fzf_darwin_amd64
|
||||||
elif [ "$ARCHI" = "Linux x86_64" ]; then
|
elif [ "$ARCHI" = "Linux x86_64" ]; then
|
||||||
|
@ -25,7 +25,10 @@ SOURCES = $(wildcard *.go fzf/*.go)
|
|||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
build: $(BINARY)
|
build: $(BINARY).tar.gz
|
||||||
|
|
||||||
|
$(BINARY).tar.gz: $(BINARY)
|
||||||
|
cd fzf && tar -czf $(notdir $(BINARY)).tar.gz $(notdir $(BINARY))
|
||||||
|
|
||||||
$(BINARY): $(SOURCES)
|
$(BINARY): $(SOURCES)
|
||||||
go get
|
go get
|
||||||
@ -37,7 +40,7 @@ install: $(BINARY)
|
|||||||
cp -f $(BINARY) $(BINDIR)/fzf
|
cp -f $(BINARY) $(BINDIR)/fzf
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(BINARY)
|
rm -f $(BINARY) $(BINARY).tar.gz
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
docker build -t junegunn/ubuntu-sandbox .
|
docker build -t junegunn/ubuntu-sandbox .
|
||||||
|
Loading…
Reference in New Issue
Block a user