diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-04-03 01:50:45 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-04-03 01:50:45 +0200 |
commit | 3afce7de56161994dec3e33518f0ccdc0e082331 (patch) | |
tree | 0aef4c550b2d0822bab3324587cb48e04a4c3412 | |
parent | d4fbb03b40657c0036652eef571256a173ab00e4 (diff) |
feat(util): safe loading of plugin
-rw-r--r-- | fnl/util.fnl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fnl/util.fnl b/fnl/util.fnl new file mode 100644 index 0000000..ae52bac --- /dev/null +++ b/fnl/util.fnl @@ -0,0 +1,10 @@ +;; Utility functions. +(module util) + +(defn load-plugin [name] + (let [(ok? val-or-err) (pcall require name)] + (when ok? + (val-or-err)) + (when (not ok?) + (print "Could not load config: " val-or-err)))) + |