Set profile using CLI argument

This commit is contained in:
The Magician 2024-09-12 13:29:43 +01:00
parent de8145e8b6
commit a18c9b2101
1 changed files with 8 additions and 1 deletions

View File

@ -1,13 +1,20 @@
package main
import (
"os"
"sevenkeys/cli"
"sevenkeys/database"
"sevenkeys/figlet"
)
func main() {
db := database.GetDatabaseFromConfig("config.json")
var profile string
if len(os.Args) < 2 {
profile = "production"
} else {
profile = os.Args[1]
}
db := database.GetDatabaseFromConfig("config." + profile + ".json")
figlet.ReadFigletFonts()
cli.ShowSplashScreen()