generalize
This commit is contained in:
parent
d7f30907ed
commit
6adb905ae1
@ -16,8 +16,8 @@ func check(err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func pipedCmd(path, source string) string {
|
func pipedCmd(path string, argv []string, source string) string {
|
||||||
cmd := exec.Command(path)
|
cmd := exec.Command(path, argv...)
|
||||||
in, err := cmd.StdinPipe()
|
in, err := cmd.StdinPipe()
|
||||||
check(err)
|
check(err)
|
||||||
out, err := cmd.StdoutPipe()
|
out, err := cmd.StdoutPipe()
|
||||||
@ -46,9 +46,8 @@ func main() {
|
|||||||
// binaries, remember their paths.
|
// binaries, remember their paths.
|
||||||
markdownPath, err := exec.LookPath("markdown");
|
markdownPath, err := exec.LookPath("markdown");
|
||||||
check(err)
|
check(err)
|
||||||
fmt.Print(pipedCmd(markdownPath, "## wat"))
|
|
||||||
// pygmentizePath, err := exec.LookPath("pygmentize")
|
// pygmentizePath, err := exec.LookPath("pygmentize")
|
||||||
// check(err)
|
// check(err)
|
||||||
|
|
||||||
//
|
fmt.Print(pipedCmd(markdownPath, []string{}, "## wat"))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user