Skip to content

feat: add KREWFILE env var support#16

Merged
brumhard merged 1 commit intobrumhard:mainfrom
nikolay:feat/env/add-krewfile-env-var-support
Dec 29, 2025
Merged

feat: add KREWFILE env var support#16
brumhard merged 1 commit intobrumhard:mainfrom
nikolay:feat/env/add-krewfile-env-var-support

Conversation

@nikolay
Copy link
Copy Markdown
Contributor

@nikolay nikolay commented Nov 12, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 12, 2025 10:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 KREWFILE environment 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.

Comment on lines +41 to +44
var defaultKrewfileLocation string = os.Getenv("KREWFILE")
if defaultKrewfileLocation == "" {
defaultKrewfileLocation = filepath.Join(home, ".krewfile")
}
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot implement the changes based on this feedback

@brumhard brumhard changed the title feat(env): add KREWFILE env var support feat: add KREWFILE env var support Dec 29, 2025
@brumhard brumhard merged commit f9bdc80 into brumhard:main Dec 29, 2025
6 checks passed
@brumhard
Copy link
Copy Markdown
Owner

Thanks for the feature, I'll release it shortly

@brumhard
Copy link
Copy Markdown
Owner

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jan 9, 2026
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 ([@&#8203;brumhard](https://github.com/brumhard))
- [`b9ec650`](brumhard/krewfile@b9ec650): chore: fix nixpkgs 25.11 deprecation of system ([#&#8203;18](brumhard/krewfile#18)) ([@&#8203;Red-M](https://github.com/Red-M))
- [`dc1e6eb`](brumhard/krewfile@dc1e6eb): chore: release v0.7.0 ([@&#8203;brumhard](https://github.com/brumhard))
- [`bf6ab24`](brumhard/krewfile@bf6ab24): chore: update deps & fix deprecations ([@&#8203;brumhard](https://github.com/brumhard))
- [`f9bdc80`](brumhard/krewfile@f9bdc80): feat(env): add KREWFILE env var support ([#&#8203;16](brumhard/krewfile#16)) ([@&#8203;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-->
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.

3 participants