going to compile
This commit is contained in:
parent
276a364b2e
commit
d3faaa574c
@ -3,6 +3,12 @@
|
|||||||
Go by Example book source.
|
Go by Example book source.
|
||||||
|
|
||||||
|
|
||||||
|
### Building Tools
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ tool/build
|
||||||
|
```
|
||||||
|
|
||||||
### Numbering
|
### Numbering
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
mkdir -p build
|
|
||||||
cp style/book.css build/book.css
|
|
30
tool/generate.go
Normal file
30
tool/generate.go
Normal 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)
|
||||||
|
}
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
exec go run tool/renumber.go
|
|
Loading…
x
Reference in New Issue
Block a user