aboutsummaryrefslogtreecommitdiffstats
path: root/config.go
AgeCommit message (Collapse)Author
2017-06-03loadConfig(): Load from real XDG configTeddy Wing
Instead of loading the config file I've been testing with in the local project directory, load the real one from XDG_CONFIG_HOME.
2017-06-03config.go: Extract config file paths to functionsTeddy Wing
Put these constructed paths into reusable functions for easier usage.
2017-06-03Make `MaybeWriteConfig()` a private functionTeddy Wing
I figured it would be a good idea to make this function and `loadConfig()` consistent. Since `loadConfig()` is private, make this one private also.
2017-06-03Move `Config` & `loadConfig()` to config.goTeddy Wing
Now that we have a 'config.go' file, it makes more sense for these two to live in that file. Change `loadConfig()` to return an error instead of printing it to the log.
2017-06-03MaybeWriteConfig(): Write an empty config fileTeddy Wing
If no existing config file is found, write a sample config file to XDG_CONFIG_HOME/timetasker/config.toml.
2017-06-03Add `MaybeWriteConfig()`Teddy Wing
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.