mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 00:46:30 +00:00
Fix skip setup for some general cli commands (#3498)
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
This commit is contained in:
parent
2268c0c2ae
commit
b6b2ab0901
1 changed files with 4 additions and 2 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"os"
|
||||
"slices"
|
||||
|
||||
"github.com/adrg/xdg"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
@ -17,9 +18,10 @@ type Config struct {
|
|||
LogLevel string `json:"log_level"`
|
||||
}
|
||||
|
||||
var skipSetupForCommands = []string{"setup", "help", "h", "version", "update", "lint", ""}
|
||||
|
||||
func Load(c *cli.Context) error {
|
||||
// If the command is setup, we don't need to load the config
|
||||
if firstArg := c.Args().First(); firstArg == "setup" {
|
||||
if firstArg := c.Args().First(); slices.Contains(skipSetupForCommands, firstArg) {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue