feat: add Default config which applies to all servers - #61
Conversation
| NvimCmd []string `yaml:"nvim-cmd,omitempty"` | ||
| UsePorts *bool `yaml:"use-ports,omitempty"` | ||
| SshArg []string `yaml:"ssh-arg,omitempty"` | ||
| SshPath string `yaml:"ssh-path,omitempty"` |
There was a problem hiding this comment.
Given where ApplyPrecedence is called in the flow, getSshPath isn't applied to it. So in yaml ssh-path: binary would look for a literal executable named binary in your $PATH, and not actually use the default.
| SshArg []string `yaml:"ssh-arg,omitempty"` | ||
| SshPath string `yaml:"ssh-path,omitempty"` | ||
| LocalEditor []string `yaml:"local-editor,omitempty"` | ||
| ServerEnv map[string]string `yaml:"server-env,omitempty"` |
There was a problem hiding this comment.
Would prefer if this was just []string:
- via cli arg, they're
FOO=bar - via env vars, they're
FOO=bar - via yaml, they're
FOO: bar
There was a problem hiding this comment.
Ah, more changes are needed to pipe these through is the issue.
| return err | ||
| } | ||
|
|
||
| // Fall back to environment variables if still not set. |
There was a problem hiding this comment.
Huh, I can see that was was just moved to DRY the yaml -> CLI stuff, so I might have had a bug here. I have $NVRH_CLIENT_SERVER_ENV set in my environment and that's taking precedence over anything in the YAML.
| SshArg []string `yaml:"ssh-arg,omitempty"` | ||
| SshPath string `yaml:"ssh-path,omitempty"` | ||
| LocalEditor []string `yaml:"local-editor,omitempty"` | ||
| ServerEnv map[string]string `yaml:"server-env,omitempty"` |
There was a problem hiding this comment.
Ah, more changes are needed to pipe these through is the issue.
| } | ||
|
|
||
| var envIndex = map[string][]string{ | ||
| "ssh-path": {"NVRH_CLIENT_SSH_PATH"}, |
There was a problem hiding this comment.
When adding to this, we need to remove the source from the CLI command, similar to
Lines 67 to 72 in 720d3d7
…t-server-config * 'main' of https://github.com/mikew/nvrh: fix: Add pull_request trigger to ci
|
I went ahead and made those changes, this works a treat, thanks for the PR! |
🤖 I have created a release *beep* *boop* --- ## [0.5.0](v0.4.0...v0.5.0) (2025-10-01) ### Features * add Default config which applies to all servers ([#61](#61)) ([ab63473](ab63473)) * replace remote directory's leading tilde with HOME variable ([#64](#64)) ([e4c2710](e4c2710)) ### Bug Fixes * Add pull_request trigger to ci ([ccfce59](ccfce59)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR adds Default config which applies to all servers, with some extra configuration such as local-editor.
This PR closes #60 .
The configuration file will look like: