Skip to content

Commit 61922ee

Browse files
committed
Support --config option in publish subcommand.
Signed-off-by: Felix Fontein <felix@fontein.de>
1 parent 8296378 commit 61922ee

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

cmd/sops/main.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,15 @@ func main() {
359359
if c.Bool("verbose") || c.GlobalBool("verbose") {
360360
logging.SetLevel(logrus.DebugLevel)
361361
}
362-
configPath, err := config.FindConfigFile(".")
363-
if err != nil {
364-
return common.NewExitError(err, codes.ErrorGeneric)
362+
var configPath string
363+
var err error
364+
if c.GlobalString("config") != "" {
365+
configPath = c.GlobalString("config")
366+
} else {
367+
configPath, err = config.FindConfigFile(".")
368+
if err != nil {
369+
return common.NewExitError(err, codes.ErrorGeneric)
370+
}
365371
}
366372
if c.NArg() < 1 {
367373
return common.NewExitError("Error: no file specified", codes.NoFileSpecified)

0 commit comments

Comments
 (0)