Skip to content

Commit

Permalink
Prioritize windows when formatting filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
gandarez committed May 8, 2024
1 parent 42030f4 commit 6b6917c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/wakatime/wakatime-cli

go 1.22.2
go 1.22.3

require (
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
Expand Down
10 changes: 5 additions & 5 deletions pkg/heartbeat/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ func WithFormatting() HandleOption {
}
}

// Format accepts a heartbeat formats it's filepath and returns the formatted version.
// Format accepts a heartbeat to format its filepath and returns the formatted version.
func Format(h Heartbeat) Heartbeat {
if !h.IsUnsavedEntity && (runtime.GOOS != "windows" || !windows.IsWindowsNetworkMount(h.Entity)) {
formatLinuxFilePath(&h)
}

if runtime.GOOS == "windows" {
formatWindowsFilePath(&h)
}

if !h.IsUnsavedEntity && !windows.IsWindowsNetworkMount(h.Entity) {
formatLinuxFilePath(&h)
}

return h
}

Expand Down

0 comments on commit 6b6917c

Please sign in to comment.