Skip to content

Commit

Permalink
Add trailing slash to directory name
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislbr committed Apr 11, 2024
1 parent 2066397 commit b96a84e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func main() {
if len(staged) == 0 {
continue
}
if t.Directory != "" && !strings.Contains(string(staged), t.Directory) {
if t.Directory != "" && !strings.Contains(string(staged), addTrailingSlash(t.Directory)) {
continue
}
}
Expand Down Expand Up @@ -214,3 +214,13 @@ func runTask(t task) (string, error) {

return string(output), nil
}

func addTrailingSlash(dir string) string {
if runtime.GOOS == "windows" {
dir += "\\"
} else {
dir += "/"
}

return dir
}

0 comments on commit b96a84e

Please sign in to comment.