diff --git a/README.md b/README.md index 78273a5..a55eb13 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,7 @@ On Linux: systemctl --user stop clipper.service systemctl --user disable clipper.service sudo rm /usr/local/bin/clipper + rm -r ~/.config/clipper To kill a manually-launched instance of Clipper, just hit Control+C in the terminal where it is running. diff --git a/clipper.go b/clipper.go index 28fea9e..57c759b 100644 --- a/clipper.go +++ b/clipper.go @@ -266,6 +266,10 @@ func main() { // Merge flags -> config -> defaults. mergeSettings() + if runtime.GOOS == "linux" { + configDir := expandPath(filepath.Dir(settings.Logfile.value)) + os.MkdirAll(configDir, 0700) + } expandedPath := expandPath(settings.Logfile.value) outfile, err := os.OpenFile(expandedPath, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600) if err != nil {