This commit is contained in:
parent
3a8e3dfcf4
commit
1bb0ddd253
|
@ -122,8 +122,8 @@ func parseConfFile(path string) (conf Conf, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func commitMsgToConf() (conf Conf, err error) {
|
func commitMsgToConf(metaConfPath string) (conf Conf, err error) {
|
||||||
metaConf, err := parseMetaConfFile("meta-conf.json")
|
metaConf, err := parseMetaConfFile(metaConfPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"flag"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
@ -70,8 +71,15 @@ func outputResult(conf Conf, results []stage.StageResult) error {
|
||||||
append(content, []byte("\n")...), 0o600)
|
append(content, []byte("\n")...), 0o600)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var metaConfPath string
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
flag.StringVar(&metaConfPath, "meta-conf", "meta-conf.json", "meta config file path")
|
||||||
|
}
|
||||||
|
|
||||||
func mainImpl() error {
|
func mainImpl() error {
|
||||||
conf, err := commitMsgToConf()
|
flag.Parse()
|
||||||
|
conf, err := commitMsgToConf(metaConfPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("no conf found", "error", err)
|
slog.Error("no conf found", "error", err)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue
Block a user