Skip to content

Commit

Permalink
Windows: clipboard log filename fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dhamith93 committed Oct 20, 2021
1 parent 592387e commit be697db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fileops.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ func fileList(path string) []fs.FileInfo {
}

func writeClipboardToFile(contents []byte) {
path := "clipboard_" + strings.ReplaceAll(time.Now().Format("2006-01-02 15:04:05"), " ", "_") + ".json"
dateStr := strings.ReplaceAll(strings.ReplaceAll(time.Now().Format("2006-01-02 15:04:05"), " ", "_"), ":", "")
path := "clipboard_" + dateStr + ".json"
err := ioutil.WriteFile(path, contents, 0644)
if err != nil {
Log("error", err.Error())
Expand Down

0 comments on commit be697db

Please sign in to comment.