mirror of
https://github.com/Gu1llaum-3/sshm.git
synced 2026-03-14 03:41:27 +01:00
Compare commits
3 Commits
v1.7.0
...
3d746ec49a
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d746ec49a | |||
| f31fe9dacf | |||
| 7b15db1f34 |
@@ -53,6 +53,11 @@ SSHM is a beautiful command-line tool that transforms how you manage and connect
|
|||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
|
**Homebrew (Recommended for macOS):**
|
||||||
|
```bash
|
||||||
|
brew install Gu1llaum-3/sshm/sshm
|
||||||
|
```
|
||||||
|
|
||||||
**Unix/Linux/macOS (One-line install):**
|
**Unix/Linux/macOS (One-line install):**
|
||||||
```bash
|
```bash
|
||||||
curl -sSL https://raw.githubusercontent.com/Gu1llaum-3/sshm/main/install/unix.sh | bash
|
curl -sSL https://raw.githubusercontent.com/Gu1llaum-3/sshm/main/install/unix.sh | bash
|
||||||
|
|||||||
@@ -56,7 +56,25 @@ getLatestVersion() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
downloadBinary() {
|
downloadBinary() {
|
||||||
GITHUB_FILE="sshm-${OS}-${ARCH}.tar.gz"
|
# Map OS names to match GoReleaser format
|
||||||
|
local GORELEASER_OS="$OS"
|
||||||
|
case $OS in
|
||||||
|
"darwin") GORELEASER_OS="Darwin" ;;
|
||||||
|
"linux") GORELEASER_OS="Linux" ;;
|
||||||
|
"windows") GORELEASER_OS="Windows" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Map architecture names to match GoReleaser format
|
||||||
|
local GORELEASER_ARCH="$ARCH"
|
||||||
|
case $ARCH in
|
||||||
|
"amd64") GORELEASER_ARCH="x86_64" ;;
|
||||||
|
"arm64") GORELEASER_ARCH="arm64" ;;
|
||||||
|
"386") GORELEASER_ARCH="i386" ;;
|
||||||
|
"arm") GORELEASER_ARCH="armv6" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# GoReleaser format: sshm_Darwin_arm64.tar.gz
|
||||||
|
GITHUB_FILE="sshm_${GORELEASER_OS}_${GORELEASER_ARCH}.tar.gz"
|
||||||
GITHUB_URL="https://github.com/Gu1llaum-3/sshm/releases/download/$LATEST_VERSION/$GITHUB_FILE"
|
GITHUB_URL="https://github.com/Gu1llaum-3/sshm/releases/download/$LATEST_VERSION/$GITHUB_FILE"
|
||||||
|
|
||||||
printf "${YELLOW}Downloading $GITHUB_FILE...${NC}\n"
|
printf "${YELLOW}Downloading $GITHUB_FILE...${NC}\n"
|
||||||
@@ -74,8 +92,8 @@ downloadBinary() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if the expected binary exists (no find needed)
|
# GoReleaser extracts the binary as just "sshm", not with the platform suffix
|
||||||
EXTRACTED_BINARY="./sshm-${OS}-${ARCH}"
|
EXTRACTED_BINARY="./sshm"
|
||||||
if [ ! -f "$EXTRACTED_BINARY" ]; then
|
if [ ! -f "$EXTRACTED_BINARY" ]; then
|
||||||
printf "${RED}Could not find extracted binary: $EXTRACTED_BINARY${NC}\n"
|
printf "${RED}Could not find extracted binary: $EXTRACTED_BINARY${NC}\n"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -80,7 +80,11 @@ if ($LocalBinary -ne "") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Download binary
|
# Download binary
|
||||||
$fileName = "sshm-windows-$arch.zip"
|
# Map architecture to match GoReleaser format
|
||||||
|
$goreleaserArch = if ($arch -eq "amd64") { "x86_64" } else { "i386" }
|
||||||
|
|
||||||
|
# GoReleaser format: sshm_Windows_x86_64.zip
|
||||||
|
$fileName = "sshm_Windows_$goreleaserArch.zip"
|
||||||
$downloadUrl = "https://github.com/Gu1llaum-3/sshm/releases/download/$latestVersion/$fileName"
|
$downloadUrl = "https://github.com/Gu1llaum-3/sshm/releases/download/$latestVersion/$fileName"
|
||||||
$tempFile = "$env:TEMP\$fileName"
|
$tempFile = "$env:TEMP\$fileName"
|
||||||
|
|
||||||
@@ -101,7 +105,8 @@ if ($LocalBinary -ne "") {
|
|||||||
Write-Info "Extracting..."
|
Write-Info "Extracting..."
|
||||||
try {
|
try {
|
||||||
Expand-Archive -Path $tempFile -DestinationPath $env:TEMP -Force
|
Expand-Archive -Path $tempFile -DestinationPath $env:TEMP -Force
|
||||||
$extractedBinary = "$env:TEMP\sshm-windows-$arch.exe"
|
# GoReleaser extracts the binary as just "sshm.exe", not with platform suffix
|
||||||
|
$extractedBinary = "$env:TEMP\sshm.exe"
|
||||||
$targetPath = "$InstallDir\sshm.exe"
|
$targetPath = "$InstallDir\sshm.exe"
|
||||||
|
|
||||||
Move-Item -Path $extractedBinary -Destination $targetPath -Force
|
Move-Item -Path $extractedBinary -Destination $targetPath -Force
|
||||||
|
|||||||
Reference in New Issue
Block a user