state: fixed input dir encoding on windows

Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
This commit is contained in:
Sam Alba 2021-11-05 17:16:23 -07:00
parent de6afee89c
commit 21e1f89f3a

View File

@ -119,9 +119,14 @@ func (dir dirInput) Compile(_ string, state *State) (*compiler.Value, error) {
return nil, fmt.Errorf("%q dir doesn't exist", dir.Path) return nil, fmt.Errorf("%q dir doesn't exist", dir.Path)
} }
dirPath, err := json.Marshal(p)
if err != nil {
return nil, err
}
llb := fmt.Sprintf( llb := fmt.Sprintf(
`#up: [{do:"local",dir:"%s", include:%s, exclude:%s}]`, `#up: [{do:"local",dir:%s, include:%s, exclude:%s}]`,
p, dirPath,
includeLLB, includeLLB,
excludeLLB, excludeLLB,
) )