]> Nishi Git Mirror - aya.git/commitdiff
Replace some fmt calls with log 0.5.6
authorIzuru Yakumo <yakumo.izuru@chaotic.ninja>
Sat, 29 Apr 2023 04:42:07 +0000 (01:42 -0300)
committerIzuru Yakumo <yakumo.izuru@chaotic.ninja>
Sat, 29 Apr 2023 04:42:07 +0000 (01:42 -0300)
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
cmd/aya/main.go

index c3152bc20fa42c04e8c424edb6a5d37621ea4ea0..15a37371dfcadd4110893d647a1448c902c1dfa7 100644 (file)
@@ -402,19 +402,19 @@ func main() {
                        buildAll(false)
                } else if len(args) == 1 {
                        if err := build(args[0], os.Stdout, globals()); err != nil {
-                               fmt.Println("ERROR: " + err.Error())
+                               log.Fatal("ERROR: " + err.Error())
                        }
                } else {
-                       fmt.Println("ERROR: too many arguments")
+                       log.Fatal("ERROR: too many arguments")
                }
        case "clean":
-               fmt.Println("Removing generated site directory")
+               log.Println("Removing generated site directory")
                os.RemoveAll(PUBDIR)
        case "serve":
                servePubDir()
        case "var":
                if len(args) == 0 {
-                       fmt.Println("var: filename expected")
+                       log.Fatal("var: filename expected")
                } else {
                        s := ""
                        if vars, _, err := getVars(args[0], Vars{}); err != nil {
@@ -439,9 +439,9 @@ func main() {
                buildAll(true)
        default:
                if s, err := run(globals(), cmd, args...); err != nil {
-                       fmt.Println(err)
+                       log.Println(err)
                } else {
-                       fmt.Println(s)
+                       log.Println(s)
                }
        }
 }