changeset 62:2d9f9b32ae1f draft

Add a clean subcommand Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
author yakumo.izuru
date Sat, 29 Apr 2023 04:37:22 +0000
parents e8f54da51137
children 1bd8a674a30c
files aya.1 cmd/aya/main.go
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/aya.1	Wed Apr 26 12:40:20 2023 +0000
+++ b/aya.1	Sat Apr 29 04:37:22 2023 +0000
@@ -19,6 +19,8 @@
 .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
--- a/cmd/aya/main.go	Wed Apr 26 12:40:20 2023 +0000
+++ b/cmd/aya/main.go	Sat Apr 29 04:37:22 2023 +0000
@@ -380,6 +380,7 @@
 	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 @@
 		} else {
 			fmt.Println("ERROR: too many arguments")
 		}
+	case "clean":
+		fmt.Println("Removing generated site directory")
+		os.RemoveAll(PUBDIR)
 	case "serve":
 		servePubDir()
 	case "var":