From e3be1027a4390e1a0b964182f680b3cc9fb5d8a3 Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Fri, 30 Jun 2023 21:05:25 +0200 Subject: [PATCH] fix: Installation script --- README.md | 2 +- install.sh | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index eeb9bd2..4a37cf0 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Blendr is a terminal UI app for browsing BLE (Bluetooth Low Energy) devices. It allows you to inspect, search, connect, and analyze data coming from BLE devices directly from your terminal. -It was designed for day-to-day use by BLE engineers so the core features are **useful search**, direct connection to any characteristic and device with **one command**, and displaying **your custom services names** in the UI. [Learn more](#usage). +It was designed for day-to-day use by BLE engineers so the core features are **useful search**, direct connection to any characteristic and device with **one command**, and displaying **your custom services names** in the UI. [Learn more](#usage)

demo diff --git a/install.sh b/install.sh index 9749f36..22eb442 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/sh -base_url="https://github.com/dmtrKovalenko/blendr/releases/download/latest" +base_url="https://github.com/dmtrKovalenko/blendr/releases/latest/download" # Function to check if a command exists command_exists() { @@ -22,7 +22,7 @@ install_binary() { local install_dir="" if [ "$platform" = "darwin" ]; then - install_dir="/usr/local/bin" + install_dir="$HOME/.local/bin" elif [ "$platform" = "linux" ]; then install_dir="/usr/local/bin" elif [ "$platform" = "mingw"* ]; then @@ -48,12 +48,15 @@ install_binary() { echo "Downloaded binary '$binary_file' successfully!" fi + echo "$binary_file" tar -xzf "$binary_file" chmod +x blendr mv blendr "$install_dir" - mv blendr.1 /usr/local/share/man/man1 - echo "Binary installed successfully in '$install_dir'!" + mkdir -p $HOME/share/man/man1 + mv blendr.1 $HOME/share/man/man1 + + rm "$binary_file" } # Determine the platform and architecture @@ -65,10 +68,10 @@ case "$platform" in "darwin") case "$arch" in "arm64") - binary_url="$base_url/latest/download/blendr-aarch64-apple-darwin.tar.gz" + binary_url="$base_url/blendr-aarch64-apple-darwin.tar.gz" ;; "x86_64") - binary_url="$base_url/latest/download/blendr-x86_64-apple-darwin.tar.gz" + binary_url="$base_url/blendr-x86_64-apple-darwin.tar.gz" ;; *) print_manual_instructions "$base_url"