feat: support read config file from stdin
Some checks are pending
Trigger CMFA Update / trigger-CMFA-update (push) Waiting to run

via `-f -`
This commit is contained in:
wwqgtxx 2024-12-10 09:57:20 +08:00
parent 9a959202ed
commit f3a43fe3a6

View File

@ -5,6 +5,7 @@ import (
"encoding/base64"
"flag"
"fmt"
"io"
"net"
"os"
"os/signal"
@ -99,6 +100,13 @@ func main() {
log.Fatalln("Initial configuration error: %s", err.Error())
return
}
} else if configFile == "-" {
var err error
configBytes, err = io.ReadAll(os.Stdin)
if err != nil {
log.Fatalln("Initial configuration error: %s", err.Error())
return
}
} else {
if configFile != "" {
if !filepath.IsAbs(configFile) {