Skip to content

Commit

Permalink
Try to ensure the profiles dir exists when termshark starts
Browse files Browse the repository at this point in the history
Otherwise the new-profile command will fail.
  • Loading branch information
gcla committed Jun 13, 2022
1 parent c5bfbef commit 4cc4668
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/termshark/termshark.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4cc4668

Please sign in to comment.