|
|
@ -29,8 +29,8 @@ func Command() (string, []string) {
|
|
|
|
func Script(commands []string) string {
|
|
|
|
func Script(commands []string) string {
|
|
|
|
var buf bytes.Buffer
|
|
|
|
var buf bytes.Buffer
|
|
|
|
for _, command := range commands {
|
|
|
|
for _, command := range commands {
|
|
|
|
escaped := fmt.Sprintf("%q", command)
|
|
|
|
escaped := fmt.Sprintf("%q", "+ "+command)
|
|
|
|
escaped = strings.Replace(escaped, "$", `\$`, -1)
|
|
|
|
escaped = strings.Replace(escaped, "$", "`$", -1)
|
|
|
|
buf.WriteString(fmt.Sprintf(
|
|
|
|
buf.WriteString(fmt.Sprintf(
|
|
|
|
traceScript,
|
|
|
|
traceScript,
|
|
|
|
escaped,
|
|
|
|
escaped,
|
|
|
@ -53,6 +53,6 @@ $erroractionpreference = "stop"
|
|
|
|
// traceScript is a helper script that is added to
|
|
|
|
// traceScript is a helper script that is added to
|
|
|
|
// the build script to trace a command.
|
|
|
|
// the build script to trace a command.
|
|
|
|
const traceScript = `
|
|
|
|
const traceScript = `
|
|
|
|
Write-Output ('+ %s');
|
|
|
|
echo %s
|
|
|
|
& %s; if ($LASTEXITCODE -ne 0) {exit $LASTEXITCODE}
|
|
|
|
%s
|
|
|
|
`
|
|
|
|
`
|
|
|
|