From 056396f5b16c0a0067dbc539c3e1c1817870a9b4 Mon Sep 17 00:00:00 2001 From: Joinhack Date: Fri, 9 May 2025 10:08:44 +0800 Subject: [PATCH 1/2] Unified installation location --- download.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/download.sh b/download.sh index 7210c1bb2..9f5d114f7 100755 --- a/download.sh +++ b/download.sh @@ -1,5 +1,7 @@ #!/bin/bash -TMP_DIR="/tmp/blsjavy" +TMP_DIR="$(mktemp -d)" +BRIGHT_GREEN="\033[92m" +NC="\033[0m" function cleanup { rm -rf $TMP_DIR > /dev/null } @@ -16,7 +18,7 @@ function install { MOVE="true" RELEASE="latest" INSECURE="false" - OUT_DIR="$HOME/.bin" + OUT_DIR="$HOME/.blessnet/bin" GH="https://github.com" #bash check [ ! "$BASH_VERSION" ] && fail "Please use bash instead" @@ -92,6 +94,7 @@ function install { echo "....." + OLD_DIR=$(pwd) #enter tempdir mkdir -p $TMP_DIR cd $TMP_DIR @@ -121,8 +124,9 @@ function install { mv $TMP_BIN $OUT_DIR/$PROG || fail "mv failed" #FINAL STEP! echo "Installed $PROG $VERSION at $OUT_DIR/$PROG" #done + cd $OLD_DIR cleanup echo "Please add the following line to your .bashrc or .zshrc:" - echo 'export PATH="$HOME/.bin:$PATH"' + echo -e "${BRIGHT_GREEN}export PATH=$OUT_DIR:\$PATH${NC}" } install $1 \ No newline at end of file From 4ae9b7aaeca9b2d30448f5b5ec507dae069825ca Mon Sep 17 00:00:00 2001 From: Joinhack Date: Fri, 9 May 2025 10:37:39 +0800 Subject: [PATCH 2/2] use bls-javy as binary name. --- download.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/download.sh b/download.sh index 9f5d114f7..7b2222472 100755 --- a/download.sh +++ b/download.sh @@ -14,7 +14,7 @@ function fail { } function install { #settings - PROG='blsjavy' + PROG='bls-javy' MOVE="true" RELEASE="latest" INSECURE="false" @@ -30,6 +30,7 @@ function install { which tail > /dev/null || fail "tail not installed" which cut > /dev/null || fail "cut not installed" which du > /dev/null || fail "du not installed" + which jq > /dev/null || fail "jq not installed" GET="" if which curl > /dev/null; then GET="curl" @@ -66,7 +67,7 @@ function install { #choose from asset list URL="" FTYPE="" - DEFAULT_VERSION="v1.4.0" + DEFAULT_VERSION=$(curl -L https://api.github.com/repos/blessnetwork/bls-javy/releases/latest|jq -r '.tag_name') VERSION=${1:-$DEFAULT_VERSION} case "${OS}_${ARCH}" in "darwin_amd64")