Skip to content

Fix local: version: readonly variable error in feature install scripts - #212

Merged
sebst merged 3 commits into
mainfrom
copilot/fix-installation-issue-variant
Mar 26, 2026
Merged

sebst merged 3 commits into
mainfrom
copilot/fix-installation-issue-variant

Conversation

Copilot AI commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

Inside install(), readonly version="${VERSION:?}" creates a global readonly variable. When github_get_tag_for_version() is subsequently called, its local version="$2" declaration fails — bash won't shadow a global readonly with a local.

# Before (broken): local version="$2" conflicts with global readonly version
github_get_tag_for_version() {
    local repo="$1"
    local version="$2"          # ← fails: version is already readonly
    ...
    escaped_version="$(printf '%s' "$version" | sed 's/\./\\./g')"
}

# After (fixed): matches the pattern already used in src/fzf/install.sh
github_get_tag_for_version() {
    local repo="$1"
    local _version="$2"         # ← no conflict
    ...
    escaped_version="$(printf '%s' "$_version" | sed 's/\./\\./g')"
}

Changes

  • 26 install.sh files — rename version → _version in github_get_tag_for_version(): astral.sh-uv, atuin.sh, bat, biomejs.dev, btop, charmbracelet-gum, chezmoi.io, delta, fd, icholy-ttygif, jj-vcs.dev, k9scli.io, neovim.io, opencode.ai, pi.dev, pulumi.com, rclone.org, restic.net, ripgrep, schpet-linear-cli, smallstep.com, starship.rs, swc.rs, yq, zellij.dev, zyedidia-eget
  • 26 devcontainer-feature.json files — patch version bumps
  • README.md — version table updated to match
Original prompt

This section details on the original issue you should resolve

<issue_title>Some features will display ./install.sh: line xyz: local: version: readonly variable during installation</issue_title>
<issue_description></issue_description>

<agent_instructions>if you can, have a look at action workflow runs to identify affected features
otherwise
run the installation routine for each feature by yourself. in this case, don't forget running as sudo if needed, and with the required uppercase parameters as env vars</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@sebst
sebst marked this pull request as ready for review March 26, 2026 15:44
Copilot AI changed the title [WIP] Fix readonly variable error during installation Fix local: version: readonly variable error in feature install scripts Mar 26, 2026
Copilot AI requested a review from sebst March 26, 2026 15:52
@sebst
sebst merged commit 2107c84 into main Mar 26, 2026
212 of 214 checks passed
@sebst
sebst deleted the copilot/fix-installation-issue-variant branch March 26, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some features will display ./install.sh: line xyz: local: version: readonly variable during installation

2 participants