mirror of
https://github.com/danog/gojekyll.git
synced 2024-11-27 09:24:38 +01:00
Lint; add subcommand usage
This commit is contained in:
parent
0dca5cf97c
commit
c466cc6c9c
@ -86,6 +86,8 @@ The gopher image in the test directory is from [Wikimedia Commons](https://commo
|
|||||||
|
|
||||||
[Jekyll](https://jekyllrb.com), of course.
|
[Jekyll](https://jekyllrb.com), of course.
|
||||||
|
|
||||||
|
This project is a clean-room implementation of Jekyll, based solely on Jekyll's documentation and testing a few sites.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
MIT
|
||||||
|
3
build.go
3
build.go
@ -39,9 +39,6 @@ func (s *Site) Clean(options BuildOptions) error {
|
|||||||
if err := filepath.Walk(s.Destination, removeFiles); err != nil {
|
if err := filepath.Walk(s.Destination, removeFiles); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if options.DryRun {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return helpers.RemoveEmptyDirectories(s.Destination)
|
return helpers.RemoveEmptyDirectories(s.Destination)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,13 +96,13 @@ func main() {
|
|||||||
},
|
},
|
||||||
Action: withSite(benchmarkCommand),
|
Action: withSite(benchmarkCommand),
|
||||||
}, {
|
}, {
|
||||||
Name: "data",
|
Name: "data",
|
||||||
Usage: "Print a file or URL path's variables",
|
Usage: "Print a file or URL path's variables",
|
||||||
Action: withSite(dataCommand),
|
Action: withSite(dataCommand),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "routes",
|
Name: "routes",
|
||||||
Usage: "Display site permalinks and associated files",
|
Usage: "Display site permalinks and associated files",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "dynamic",
|
Name: "dynamic",
|
||||||
@ -113,7 +113,7 @@ func main() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "render",
|
Name: "render",
|
||||||
Usage: "Render a file or URL path",
|
Usage: "Render a file or URL path",
|
||||||
Action: withSite(renderCommand),
|
Action: withSite(renderCommand),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -123,7 +123,9 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
pprof.StartCPUProfile(f)
|
if err = pprof.StartCPUProfile(f); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
defer pprof.StopCPUProfile()
|
defer pprof.StopCPUProfile()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user