Let mise own .mise.local.toml writes in the ide script#19
Merged
Conversation
Replace the hand-rolled set_team_id() TOML editor (grep/sed/awk/mktemp across four edge cases) with a single `mise set --file` call, which creates the file and [env] table as needed. Drops the script from 102 to 66 lines and removes the in-place TOML-munging fragility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
idebootstrap script grew a hand-rolled TOML editor —set_team_id()— that munged.mise.local.tomlin place with a four-waygrep/sed/awk/mktempbranch (no file / key already set /[env]table exists / neither). That was the only genuinely fragile part of the script.This replaces the whole function with a single
mise set --filecall, which creates the file and the[env]table as needed:Why
The original ask was "rewrite
idein Ruby since it's getting long." But the length was almost entirely the in-place TOML editing — the rest is arg parsing andmise exec -- tuist …shell-outs that wouldn't get shorter in Ruby. Rather than take on a Ruby + gem dependency (and a bootstrap chicken-and-egg), the better fix is to stop hand-editing TOML and letmise— already a hard dependency — own its own config file.Result
ide: 102 → 66 linessed/awk/mktempfragility at the sourceNotes
.mise.local.tomlno longer gets the explanatory header comments the old heredoc wrote, sincemisenow writes the TOML. Fine for a gitignored, machine-local file.miseisn't available in the authoring environment, so this was bash-syntax-checked but not executed. Manual check on a dev machine:./ide --team-id ABCDE12345 --no-openand confirm.mise.local.tomlends up withTUIST_DEVELOPMENT_TEAMunder[env].https://claude.ai/code/session_01G4JWtYvhGrirdefM8LaHbz
Generated by Claude Code