Repository navigation
Replies: 6 comments 4 replies
|
@jdx what are your feelings about this proposal? Not sure if it can be achieved by some current means, or should be done some other way? |
|
This fits, so I opened #15080. It adds [dotfiles]
"~/.config/mise/conf.d/private_env_vars.local.toml" = { source = "templates/private_env_vars.toml", mode = "copy", permissions = "0600", create_if_missing = true }If the target is missing, it is copied and the permissions are set. If anything is already there, it is left alone, content and permissions included, and I went with Until that lands, AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: 2.1.308. |
|
Your target file If the token is only for mise, skip the plaintext file and let mise ask gh when it needs the token: [settings.github]
credential_command = 'gh auth token'That goes in your global config. The login does not have to live in dotfiles either; run If the value is for some other program, use a secret input: put On |
|
About the current discussion: before I used mise, I maintained my VSCode settings the same way, with a deploy script: # copy when the target is missing, warn and skip when it exists but differs
safe_cp ./settings.json "$APPDATA/Code/User/settings.json"The reason: my Windows VSCode config is the Linux one plus a few extra lines, and VSCode also changes entries in that file by itself while it runs. So it is a repo baseline, local drift, and the app writing to it as well. That is why on Windows I copy the file over and edit the copy by hand. So I have been writing Now I want to move that file under mise, and for this case I think The problem is that VSCode's @jdx how would you handle a file like this? Do I have to fall back to Also, please look at the last line of my previous comment. My concern is that apply leaves behind a file that still needs a human edit before it works, which puts human intervention into what apply means. Is that option really needed, or is making merge handle more files the more fundamental fix? |
|
Implemented in #15080: feat(dotfiles): add create_if_missing to seed a file once |
|
Implemented in #15087: feat(dotfiles): set permissions on a file a merge entry creates |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'd like to keep a template for local API tokens in Git and have bootstrap copy it into place. I would then fill in the tokens locally and keep the destination ignored by Git.
For example, in my case my "template" looks like in my git repo tracked under
templates/private_env_vars.tomlwhich I would copy to~/.config/mise/conf.d/private_env_vars.local.toml:Normal
mode = "copy"would overwrite my changes on later applies. Currently I need a guarded task with separate commands for Unix and Windows.Could dotfiles and dotfile group entries support something like
copy_once = truealongsidemode = "copy"?Expected behavior:
Would this fit mise's dotfile management?
copy_onceis just a naming suggestion;create_if_missingmight describe the behavior more precisely.All reactions