mirror of
https://github.com/apricote/hcloud-upload-image.git
synced 2026-01-13 21:31:03 +00:00
fix(cli): completion requires HCLOUD_TOKEN (#19)
The current setup of the CLI requires the user to set HCLOUD_TOKEN for every single invocation of the binary. Even if we just want to autocomplete some arguments or even generate the completion scripts in CI. This fixes the bug by only initializing the hcloud-go client in the "cleanup" and "upload" subcommands.
This commit is contained in:
parent
f7dc501b2f
commit
bb2ca48200
4 changed files with 17 additions and 6 deletions
|
|
@ -33,6 +33,8 @@ This does cost a bit of money for the server.`,
|
|||
|
||||
GroupID: "primary",
|
||||
|
||||
PreRun: initClient,
|
||||
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
ctx := cmd.Context()
|
||||
logger := contextlogger.From(ctx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue