going to compile

This commit is contained in:
Mark McGranaghan 2012-09-23 19:04:45 -07:00
parent 276a364b2e
commit d3faaa574c
4 changed files with 36 additions and 7 deletions

View File

@ -3,6 +3,12 @@
Go by Example book source.
### Building Tools
```console
$ tool/build
```
### Numbering
```console

View File

@ -1,4 +0,0 @@
#!/bin/bash
mkdir -p build
cp style/book.css build/book.css

30
tool/generate.go Normal file
View File

@ -0,0 +1,30 @@
package main
import (
"os"
"os/exec"
"fmt"
)
func check(err error) {
if err != nil {
panic(err)
}
}
func main() {
var err error
// Accept exactly 1 argument - the input filename.
if len(os.Args) != 2 {
fmt.Fprintln(os.Stderr, "Usage: tool/generate input.go > output.html")
os.Exit(1)
}
// Ensure that we have `markdown` and `pygmentize` binaries.
markdownPath, err := exec.LookPath("markdown");
check(err)
pygmentizePath, err := exec.LookPath("pygmentize")
check(err)
fmt.Println(markdownPath, pygmentizePath)
}

View File

@ -1,3 +0,0 @@
#!/bin/bash
exec go run tool/renumber.go