mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 08:56:29 +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"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
|
"slices"
|
||||||
|
|
||||||
"github.com/adrg/xdg"
|
"github.com/adrg/xdg"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
|
@ -17,9 +18,10 @@ type Config struct {
|
||||||
LogLevel string `json:"log_level"`
|
LogLevel string `json:"log_level"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var skipSetupForCommands = []string{"setup", "help", "h", "version", "update", "lint", ""}
|
||||||
|
|
||||||
func Load(c *cli.Context) error {
|
func Load(c *cli.Context) error {
|
||||||
// If the command is setup, we don't need to load the config
|
if firstArg := c.Args().First(); slices.Contains(skipSetupForCommands, firstArg) {
|
||||||
if firstArg := c.Args().First(); firstArg == "setup" {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue