mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-12-22 15:47:59 +08:00
feat: support read config file from stdin
Some checks are pending
Trigger CMFA Update / trigger-CMFA-update (push) Waiting to run
Some checks are pending
Trigger CMFA Update / trigger-CMFA-update (push) Waiting to run
via `-f -`
This commit is contained in:
parent
9a959202ed
commit
f3a43fe3a6
8
main.go
8
main.go
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user