From 12ef5ad5d62297af90e7a4c819bd5c2835a00a05 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 3 Jun 2017 18:55:51 +0200 Subject: Add `MaybeWriteConfig()` A new function that will write a new config.toml file to the XDG_CONFIG_HOME directory. Currently it checks to see whether our config file is present. If not and our config directory isn't present, it creates it. Still need to get this to actually write the config file. Also, we won't want to call it by default in main() like we're doing now. Will likely want to hide it behind a `--write-config` flag. --- main.go | 1 + 1 file changed, 1 insertion(+) (limited to 'main.go') diff --git a/main.go b/main.go index eaef1fc..0c8a8e9 100644 --- a/main.go +++ b/main.go @@ -29,6 +29,7 @@ var config Config func main() { var err error + MaybeWriteConfig() loadConfig() // Parse command line arguments -- cgit v1.2.3