Skip to content

Commit

Permalink
fix: Installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
dmtrKovalenko committed Jun 30, 2023
1 parent f4bfeb3 commit e3be102
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<p align="center">
<img alt="demo" src="./demo.png" />
Expand Down
15 changes: 9 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit e3be102

Please sign in to comment.