]> Nishi Git Mirror - aya.git/commitdiff
Add a clean subcommand 0.5.5
authorIzuru Yakumo <yakumo.izuru@chaotic.ninja>
Sat, 29 Apr 2023 04:37:22 +0000 (01:37 -0300)
committerIzuru Yakumo <yakumo.izuru@chaotic.ninja>
Sat, 29 Apr 2023 04:37:22 +0000 (01:37 -0300)
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
aya.1
cmd/aya/main.go

diff --git a/aya.1 b/aya.1
index b9b7661023c3048bbf61926a013cd81079c3e5e3..b27a2f537f7bbb3cde092de7d89ec0ded082014a 100644 (file)
--- 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
index ef290c0e873d543646320aceea04052292dfc191..c3152bc20fa42c04e8c424edb6a5d37621ea4ea0 100644 (file)
@@ -380,6 +380,7 @@ func printUsage() {
        fmt.Printf("\n")
        fmt.Printf("Where <command> 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":