1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

WTF-510 Add error messaging if the config directories cannot be created

This commit is contained in:
Chris Cummer
2019-07-20 12:23:19 -07:00
parent 00ccf8a95b
commit 452e6f20db
4 changed files with 38 additions and 21 deletions

View File

@@ -49,7 +49,7 @@ func (widget *Widget) displayPrev() {
}
func (widget *Widget) openFile() {
confDir, _ := cfg.ConfigDir()
confDir, _ := cfg.WtfConfigDir()
wtf.OpenFile(fmt.Sprintf("%s/%s", confDir, widget.filePath))
}

View File

@@ -102,7 +102,7 @@ func (widget *Widget) init() {
// Loads the todo list from Yaml file
func (widget *Widget) load() {
confDir, _ := cfg.ConfigDir()
confDir, _ := cfg.WtfConfigDir()
filePath := fmt.Sprintf("%s/%s", confDir, widget.filePath)
fileData, _ := wtf.ReadFileBytes(filePath)
@@ -135,7 +135,7 @@ func (widget *Widget) newItem() {
// persist writes the todo list to Yaml file
func (widget *Widget) persist() {
confDir, _ := cfg.ConfigDir()
confDir, _ := cfg.WtfConfigDir()
filePath := fmt.Sprintf("%s/%s", confDir, widget.filePath)
fileData, _ := yaml.Marshal(&widget.list)