feat: add KREWFILE env var support#16
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for a KREWFILE environment variable to allow users to specify a custom default location for their krewfile. The environment variable is checked first, falling back to ~/.krewfile if not set, and can still be overridden by the -file CLI flag.
- Introduces
KREWFILEenvironment variable to configure the default krewfile location - Updates go.mod to specify Go version 1.25.4
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| main.go | Adds logic to read KREWFILE env var and use it as the default krewfile location |
| go.mod | Updates Go version to 1.25.4 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var defaultKrewfileLocation string = os.Getenv("KREWFILE") | ||
| if defaultKrewfileLocation == "" { | ||
| defaultKrewfileLocation = filepath.Join(home, ".krewfile") | ||
| } |
There was a problem hiding this comment.
The new KREWFILE environment variable feature is undocumented. Based on the README.md which documents the -file CLI parameter, the KREWFILE environment variable should also be documented to inform users of this configuration option. Consider adding a section in the README explaining that users can set the KREWFILE environment variable to specify a default krewfile location.
There was a problem hiding this comment.
@copilot implement the changes based on this feedback
|
Thanks for the feature, I'll release it shortly |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [brumhard/krewfile](https://github.com/brumhard/krewfile) | minor | `v0.6.3` → `v0.7.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>brumhard/krewfile (brumhard/krewfile)</summary> ### [`v0.7.0`](https://github.com/brumhard/krewfile/releases/tag/v0.7.0) [Compare Source](brumhard/krewfile@v0.6.3...v0.7.0) #### Changelog - [`ba42083`](brumhard/krewfile@ba42083): chore: fix deprecated goreleaser options ([@​brumhard](https://github.com/brumhard)) - [`b9ec650`](brumhard/krewfile@b9ec650): chore: fix nixpkgs 25.11 deprecation of system ([#​18](brumhard/krewfile#18)) ([@​Red-M](https://github.com/Red-M)) - [`dc1e6eb`](brumhard/krewfile@dc1e6eb): chore: release v0.7.0 ([@​brumhard](https://github.com/brumhard)) - [`bf6ab24`](brumhard/krewfile@bf6ab24): chore: update deps & fix deprecations ([@​brumhard](https://github.com/brumhard)) - [`f9bdc80`](brumhard/krewfile@f9bdc80): feat(env): add KREWFILE env var support ([#​16](brumhard/krewfile#16)) ([@​nikolay](https://github.com/nikolay)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi42OS4yIiwidXBkYXRlZEluVmVyIjoiNDIuNjkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
No description provided.