Skip to content

Commit aa3decc

Browse files
author
aliwoto
committed
Don't error out on read file, if config file doesn't exist in ParseConfigWithOption function.
Signed-off-by: aliwoto <[email protected]>
1 parent ff09989 commit aa3decc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ssg/strongParser/helpers.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ func ParseConfig(value any, filename string) error {
7575
func ParseConfigWithOption(value any, filename string, opt *ConfigParserOptions) error {
7676
p, err := Parse(filename)
7777
if err != nil {
78-
return err
78+
if opt == nil && !opt.ReadEnv {
79+
return err
80+
}
81+
82+
p = NewConfigParser()
7983
}
8084

8185
p.options = opt

0 commit comments

Comments
 (0)