From 4cc4668971ccf5fd53aecc42f6954f673616ad1f Mon Sep 17 00:00:00 2001 From: Graham Clark Date: Sun, 12 Jun 2022 22:34:38 -0400 Subject: [PATCH] Try to ensure the profiles dir exists when termshark starts Otherwise the new-profile command will fail. --- cmd/termshark/termshark.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/termshark/termshark.go b/cmd/termshark/termshark.go index c12a311..7a98ff1 100644 --- a/cmd/termshark/termshark.go +++ b/cmd/termshark/termshark.go @@ -141,6 +141,10 @@ func cmain() int { dirs = stdConf.QueryFolders(configdir.Global) if err := dirs[0].CreateParentDir("dummy"); err != nil { fmt.Fprintf(os.Stderr, "Warning: could not create config dir: %v\n", err) + } else { + if err = os.MkdirAll(filepath.Join(dirs[0].Path, "profiles"), 0755); err != nil { + fmt.Fprintf(os.Stderr, "Warning: could not create profiles dir: %v\n", err) + } } err := profiles.ReadDefaultConfig(dirs[0].Path)