Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b96a84e

Browse files
committed
Add trailing slash to directory name
1 parent 2066397 commit b96a84e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ready.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func main() {
8585
if len(staged) == 0 {
8686
continue
8787
}
88-
if t.Directory != "" && !strings.Contains(string(staged), t.Directory) {
88+
if t.Directory != "" && !strings.Contains(string(staged), addTrailingSlash(t.Directory)) {
8989
continue
9090
}
9191
}
@@ -214,3 +214,13 @@ func runTask(t task) (string, error) {
214214

215215
return string(output), nil
216216
}
217+
218+
func addTrailingSlash(dir string) string {
219+
if runtime.GOOS == "windows" {
220+
dir += "\\"
221+
} else {
222+
dir += "/"
223+
}
224+
225+
return dir
226+
}

0 commit comments

Comments
 (0)