This commit is contained in:
2024-10-09 20:36:51 +03:00
parent 9ca399447c
commit 4c7a1758d6
15 changed files with 115 additions and 49 deletions

14
main.go
View File

@ -5,6 +5,7 @@ import (
"log"
"os"
"os/signal"
"path/filepath"
"syscall"
)
@ -12,9 +13,12 @@ func ParseFlags() (string, error) {
// String that contains the configured configuration path
var configPath string
exe, _ := os.Executable()
defaultCfgPath := filepath.Dir(exe)
defaultCfgPath = filepath.Join(defaultCfgPath, "/config.yml")
// Set up a CLI flag called "-config" to allow users
// to supply the configuration file
flag.StringVar(&configPath, "config", "./config.yml", "path to config file")
flag.StringVar(&configPath, "config", defaultCfgPath, "path to config file")
// Actually parse the flags
flag.Parse()
@ -28,6 +32,14 @@ func ParseFlags() (string, error) {
return configPath, nil
}
// func getIcon(s string) []byte {
// b, err := ioutil.ReadFile(s)
// if err != nil {
// fmt.Print(err)
// }
// return b
// }
func main() {
// Generate our config based on the config supplied