3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 18:52:41 +01:00

Merge pull request #2160 from slingamn/embed

fix #2157
This commit is contained in:
Shivaram Lingamneni 2024-05-29 08:04:25 +02:00 committed by GitHub
commit ad0149be5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,7 @@ package main
import (
"bufio"
_ "embed"
"fmt"
"log"
"os"
@ -26,6 +27,9 @@ import (
var commit = "" // git hash
var version = "" // tagged version
//go:embed default.yaml
var defaultConfig string
// get a password from stdin from the user
func getPasswordFromTerminal() string {
bytePassword, err := term.ReadPassword(int(syscall.Stdin))
@ -94,6 +98,7 @@ Usage:
ergo importdb <database.json> [--conf <filename>] [--quiet]
ergo genpasswd [--conf <filename>] [--quiet]
ergo mkcerts [--conf <filename>] [--quiet]
ergo defaultconfig
ergo run [--conf <filename>] [--quiet] [--smoke]
ergo -h | --help
ergo --version
@ -173,6 +178,8 @@ Options:
if err != nil {
log.Fatal("Error while importing db:", err.Error())
}
} else if arguments["defaultconfig"].(bool) {
fmt.Print(defaultConfig)
} else if arguments["run"].(bool) {
if !arguments["--quiet"].(bool) {
logman.Info("server", fmt.Sprintf("%s starting", irc.Ver))