Open
Description
We ran into an issue when calling node -e ...
with a script that contains new lines. pulumi/pulumi#16649
Repro:
main.go:
package main
import (
"fmt"
"os/exec"
)
func main() {
argWithNewLines := `if (true) {
console.log("it's true!");
}`
cmd := exec.Command("node", "-e", argWithNewLines)
out, err := cmd.Output()
if err != nil {
fmt.Printf("Error: %s", err)
}
fmt.Println(string(out))
}
Run with:
go run main.go
When I have the Volta shim node.exe in the path, I get an error:
PS C:\Users\pulumiadmin> go run main.go
Error: exit status 1
With the actual node.exe on path, it works:
PS C:\Users\pulumiadmin> go run main.go
it's true!