Add --disable-matrix flag for testing (fix #19)
This commit is contained in:
parent
bce75062cf
commit
75ffee63c5
9
main.go
9
main.go
@ -75,6 +75,7 @@ func main() {
|
||||
// Parse arguments
|
||||
parser := argparse.NewParser("lapisdeploy", "Easily deploy Lapis web applications through Gitea webhooks")
|
||||
config_path := parser.String("c", "config", &argparse.Options{Required: false, Help: "Configuration file", Default: "./config.json"})
|
||||
disable_matrix := parser.Flag("M", "disable-matrix", &argparse.Options{Required: false, Help: "Disable Matrix chat bot", Default: false})
|
||||
if err := parser.Parse(os.Args); err != nil { // Parse arguments
|
||||
fmt.Print(parser.Usage(err)) // Show usage if there's an error
|
||||
return
|
||||
@ -95,7 +96,11 @@ func main() {
|
||||
})
|
||||
log.Printf("Starting Lapis Deploy on port %d...", configuration.port)
|
||||
|
||||
startAllSites() // Start all the servers
|
||||
go initMatrix() // Start Matrix stuff in a goroutine
|
||||
startAllSites() // Start all the servers
|
||||
if !*disable_matrix { // Only start Matrix bot if --disable-matrix isn't passed
|
||||
go initMatrix() // Start Matrix stuff in a goroutine
|
||||
} else {
|
||||
log.Print("Matrix bot is disabled!")
|
||||
}
|
||||
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", configuration.port), nil)) // Start HTTP server
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user