]> Nishi Git Mirror - aya.git/commitdiff
Fix debugability of non-existent plugins or variables in non-production mode
authorJames Mills <1290234+prologic@users.noreply.github.com>
Thu, 30 Mar 2023 11:15:08 +0000 (21:15 +1000)
committerJames Mills <1290234+prologic@users.noreply.github.com>
Thu, 30 Mar 2023 11:15:08 +0000 (21:15 +1000)
.vscode/settings.json
main.go

index bf10f164be31cc0fba69f29b46ff35a8b5a04b3b..48bb71cea3f5fc075cb415f0b419880cfaf757e3 100644 (file)
@@ -19,6 +19,7 @@
         "stefanfritsch",
         "Strikethrough",
         "tasklist",
+        "Texter",
         "wikilink",
         "yuin",
         "ZSCONFIG",
diff --git a/main.go b/main.go
index 8f77ca1676708f112794f7ea9fd218f7bcfd7ab1..a73aa28fa4cb3393b37e8fb7f09ecba96710a35c 100644 (file)
--- a/main.go
+++ b/main.go
@@ -455,6 +455,10 @@ func render(s string, vars Vars) (string, error) {
                        } else {
                                log.WithError(err).Warnf("error running command: %s", m[0])
                        }
+               } else {
+                       if !viper.GetBool("production") {
+                               out.WriteString(fmt.Sprintf("%s: plugin or variable not found", m[0]))
+                       }
                }
        }