11#! /bin/bash
22
3- # Universal installer for sol-sign
3+ # Universal installer for go- sol-sign
44# Detects OS and architecture, downloads and installs appropriate binary
55
66set -e
@@ -64,7 +64,7 @@ download_file() {
6464
6565# Install function
6666install_sol_sign () {
67- echo -e " ${GREEN} 🚀 Installing sol-sign v${VERSION}${NC} "
67+ echo -e " ${GREEN} 🚀 Installing go- sol-sign v${VERSION}${NC} "
6868 echo " "
6969
7070 # Create temporary directory
@@ -77,14 +77,14 @@ install_sol_sign() {
7777
7878 # Determine file extension
7979 local extension=" tar.gz"
80- local binary_name=" sol-sign"
80+ local binary_name=" go- sol-sign"
8181 if [[ " $platform " == * " windows" * ]]; then
8282 extension=" zip"
83- binary_name=" sol-sign.exe"
83+ binary_name=" go- sol-sign.exe"
8484 fi
8585
8686 # Download archive
87- local archive_name=" sol-sign_${VERSION} _${platform} .${extension} "
87+ local archive_name=" go- sol-sign_${VERSION} _${platform} .${extension} "
8888 local download_url=" ${BASE_URL} /${archive_name} "
8989
9090 echo -e " ${BLUE} Downloading $archive_name ...${NC} "
@@ -107,7 +107,7 @@ install_sol_sign() {
107107
108108 # Install the binary
109109 local install_dir=" /usr/local/bin"
110- local install_path=" ${install_dir} /sol-sign"
110+ local install_path=" ${install_dir} /go- sol-sign"
111111
112112 echo -e " ${BLUE} Installing to $install_path ...${NC} "
113113
@@ -126,23 +126,23 @@ install_sol_sign() {
126126 rm -rf " $tmp_dir "
127127
128128 echo " "
129- echo -e " ${GREEN} ✅ sol-sign installed successfully!${NC} "
129+ echo -e " ${GREEN} ✅ go- sol-sign installed successfully!${NC} "
130130 echo " "
131131 echo -e " ${BLUE} Usage:${NC} "
132- echo " sol-sign -keypair <path> -message <message>"
132+ echo " go- sol-sign -keypair <path> -message <message>"
133133 echo " "
134134 echo -e " ${BLUE} Examples:${NC} "
135- echo " sol-sign -keypair ~/.config/solana/id.json -message \" Hello World\" "
136- echo " sol-sign -version"
135+ echo " go- sol-sign -keypair ~/.config/solana/id.json -message \" Hello World\" "
136+ echo " go- sol-sign -version"
137137 echo " "
138138 echo -e " ${BLUE} Documentation:${NC} "
139139 echo " https://github.com/${REPO} "
140140}
141141
142- # Check if sol-sign is already installed
143- if command -v sol-sign > /dev/null 2>&1 ; then
144- current_version=$( sol-sign -version 2>&1 | head -n1 | cut -d' ' -f2 || echo " unknown" )
145- echo -e " ${YELLOW} sol-sign is already installed (version: $current_version )${NC} "
142+ # Check if go- sol-sign is already installed
143+ if command -v go- sol-sign > /dev/null 2>&1 ; then
144+ current_version=$( go- sol-sign -version 2>&1 | head -n1 | cut -d' ' -f2 || echo " unknown" )
145+ echo -e " ${YELLOW} go- sol-sign is already installed (version: $current_version )${NC} "
146146 echo -e " ${YELLOW} This will update it to version v${VERSION}${NC} "
147147 echo " "
148148 read -p " Continue? (y/N): " -n 1 -r
@@ -151,6 +151,25 @@ if command -v sol-sign >/dev/null 2>&1; then
151151 echo " Installation cancelled."
152152 exit 0
153153 fi
154+ # Also check for old sol-sign installation and offer to remove it
155+ elif command -v sol-sign > /dev/null 2>&1 ; then
156+ echo -e " ${YELLOW} Found old 'sol-sign' installation${NC} "
157+ echo -e " ${YELLOW} This installer will install the new 'go-sol-sign' binary${NC} "
158+ echo " "
159+ read -p " Remove old 'sol-sign' and install 'go-sol-sign'? (y/N): " -n 1 -r
160+ echo
161+ if [[ $REPLY =~ ^[Yy]$ ]]; then
162+ echo -e " ${BLUE} Removing old sol-sign...${NC} "
163+ if [[ -w " /usr/local/bin" ]]; then
164+ rm -f /usr/local/bin/sol-sign
165+ else
166+ sudo rm -f /usr/local/bin/sol-sign
167+ fi
168+ echo -e " ${GREEN} Old sol-sign removed${NC} "
169+ else
170+ echo " Installation cancelled."
171+ exit 0
172+ fi
154173fi
155174
156175# Run installation
0 commit comments