|
|
@ -5,6 +5,7 @@ |
|
|
|
package external |
|
|
|
package external |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
|
|
|
|
"bytes" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"io" |
|
|
|
"io" |
|
|
|
"os" |
|
|
|
"os" |
|
|
@ -133,11 +134,13 @@ func (p *Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io. |
|
|
|
if !p.IsInputFile { |
|
|
|
if !p.IsInputFile { |
|
|
|
cmd.Stdin = input |
|
|
|
cmd.Stdin = input |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var stderr bytes.Buffer |
|
|
|
cmd.Stdout = output |
|
|
|
cmd.Stdout = output |
|
|
|
|
|
|
|
cmd.Stderr = &stderr |
|
|
|
process.SetSysProcAttribute(cmd) |
|
|
|
process.SetSysProcAttribute(cmd) |
|
|
|
|
|
|
|
|
|
|
|
if err := cmd.Run(); err != nil { |
|
|
|
if err := cmd.Run(); err != nil { |
|
|
|
return fmt.Errorf("%s render run command %s %v failed: %w", p.Name(), commands[0], args, err) |
|
|
|
return fmt.Errorf("%s render run command %s %v failed: %w\nStderr: %s", p.Name(), commands[0], args, err, stderr.String()) |
|
|
|
} |
|
|
|
} |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|