Skip to content

Commit 5e49b38

Browse files
andreyneringmikynov
andcommitted
Mitigate execext.Expand problems on Windows
Closes #170 Co-authored-by: mikynov <[email protected]>
1 parent 0c94ada commit 5e49b38

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
Mode is enabled
1212
([#166](https://github.com/go-task/task/issues/166));
1313
- Fix file timestamp issue when the file name has spaces
14-
([#176](https://github.com/go-task/task/issues/176)).
14+
([#176](https://github.com/go-task/task/issues/176));
15+
- Mitigating path expanding issues on Windows
16+
([#170](https://github.com/go-task/task/pull/170)).
1517

1618
## v2.3.0 - 2019-01-02
1719

internal/execext/exec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"io"
77
"os"
8+
"path/filepath"
89
"strings"
910

1011
"mvdan.cc/sh/expand"
@@ -72,6 +73,7 @@ func IsExitError(err error) bool {
7273
// Expand is a helper to mvdan.cc/shell.Fields that returns the first field
7374
// if available.
7475
func Expand(s string) (string, error) {
76+
s = filepath.ToSlash(s)
7577
s = strings.Replace(s, " ", `\ `, -1)
7678
fields, err := shell.Fields(s, nil)
7779
if err != nil {

0 commit comments

Comments
 (0)