From: Izuru Yakumo Date: Sat, 29 Apr 2023 04:37:22 +0000 (-0300) Subject: Add a clean subcommand X-Git-Tag: 0.5.5 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=07d4e1256832f7de4f19588cd073d93229a592e7;p=aya.git Add a clean subcommand Signed-off-by: Izuru Yakumo --- diff --git a/aya.1 b/aya.1 index b9b7661..b27a2f5 100644 --- a/aya.1 +++ b/aya.1 @@ -19,6 +19,8 @@ Does it need one? .Bl -tag .It build (Re-)build a site or a file in particular +.It clean +Removes the generated site directory .It serve Serve generated site over HTTP .It var diff --git a/cmd/aya/main.go b/cmd/aya/main.go index ef290c0..c3152bc 100644 --- a/cmd/aya/main.go +++ b/cmd/aya/main.go @@ -380,6 +380,7 @@ func printUsage() { fmt.Printf("\n") fmt.Printf("Where is:\n") fmt.Printf("\tbuild\tGenerate site\n") + fmt.Printf("\tclean\tRemoves the generated site directory\n") fmt.Printf("\tserve\tServe %v over HTTP\n", PUBDIR) fmt.Printf("\tvar\tQuery variable(s) from a markdown file\n") fmt.Printf("\tversion\tPrint program version and exit\n") @@ -406,6 +407,9 @@ func main() { } else { fmt.Println("ERROR: too many arguments") } + case "clean": + fmt.Println("Removing generated site directory") + os.RemoveAll(PUBDIR) case "serve": servePubDir() case "var":