🐛 fix: handle space after colon in GitHub API JSON tag_name field
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Cinco Euzebio 2026-03-01 19:59:12 -03:00
parent a8f88e852c
commit 4263f0379d
3 changed files with 7 additions and 2 deletions

View File

@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [0.8.2] - 2026-03-01
### Fixed
- `install.sh`: grep pattern for `tag_name` now handles the space GitHub includes after the colon in JSON (`"tag_name": "x"` instead of `"tag_name":"x"`)
## [0.8.1] - 2026-03-01
### Fixed

View File

@ -1,6 +1,6 @@
[package]
name = "tmuxido"
version = "0.8.1"
version = "0.8.2"
edition = "2024"
[dev-dependencies]

View File

@ -19,7 +19,7 @@ esac
api_resp=$(curl -sSL \
-H "Accept: application/vnd.github.v3+json" \
"$API_URL/repos/$REPO/releases/latest")
tag=$(printf '%s' "$api_resp" | grep -o '"tag_name":"[^"]*"' | cut -d'"' -f4)
tag=$(printf '%s' "$api_resp" | grep -o '"tag_name": *"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"')
if [ -z "$tag" ]; then
echo "Could not fetch latest release." >&2