mirror of
https://github.com/go-task/task.git
synced 2025-07-15 01:35:00 +02:00
Mitigate execext.Expand problems on Windows
Closes #170 Co-authored-by: mikynov <micnov@gmail.com>
This commit is contained in:
@ -11,7 +11,9 @@
|
|||||||
Mode is enabled
|
Mode is enabled
|
||||||
([#166](https://github.com/go-task/task/issues/166));
|
([#166](https://github.com/go-task/task/issues/166));
|
||||||
- Fix file timestamp issue when the file name has spaces
|
- Fix file timestamp issue when the file name has spaces
|
||||||
([#176](https://github.com/go-task/task/issues/176)).
|
([#176](https://github.com/go-task/task/issues/176));
|
||||||
|
- Mitigating path expanding issues on Windows
|
||||||
|
([#170](https://github.com/go-task/task/pull/170)).
|
||||||
|
|
||||||
## v2.3.0 - 2019-01-02
|
## v2.3.0 - 2019-01-02
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"mvdan.cc/sh/expand"
|
"mvdan.cc/sh/expand"
|
||||||
@ -72,6 +73,7 @@ func IsExitError(err error) bool {
|
|||||||
// Expand is a helper to mvdan.cc/shell.Fields that returns the first field
|
// Expand is a helper to mvdan.cc/shell.Fields that returns the first field
|
||||||
// if available.
|
// if available.
|
||||||
func Expand(s string) (string, error) {
|
func Expand(s string) (string, error) {
|
||||||
|
s = filepath.ToSlash(s)
|
||||||
s = strings.Replace(s, " ", `\ `, -1)
|
s = strings.Replace(s, " ", `\ `, -1)
|
||||||
fields, err := shell.Fields(s, nil)
|
fields, err := shell.Fields(s, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user