mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 09:45:36 +00:00
fix: expand quoted ~ in install dir and trim trailing slashes on mirror URLs
Addresses Pullfrog review on #24; adds a fixture test for both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017a5Cv5Z1NzdYKgKnTiAF4E
This commit is contained in:
parent
a142a3718f
commit
aabb00d3b7
2 changed files with 21 additions and 0 deletions
|
|
@ -190,6 +190,15 @@ main() {
|
|||
esac
|
||||
done
|
||||
|
||||
# A quoted --dir "~/bin" or IDX_INSTALL_DIR="~/bin" reaches us unexpanded.
|
||||
# shellcheck disable=SC2088 # matching a literal, unexpanded ~ on purpose
|
||||
case "$install_dir" in
|
||||
"~") install_dir="$HOME" ;;
|
||||
"~/"*) install_dir="$HOME/${install_dir#"~/"}" ;;
|
||||
esac
|
||||
github_url="${github_url%/}"
|
||||
api_url="${api_url%/}"
|
||||
|
||||
asset="$(detect_asset)"
|
||||
|
||||
tmp_dir="$(mktemp -d 2>/dev/null || mktemp -d -t idx-install)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue