From 053e607a49989b2d4491c20ff14c839b7161d713 Mon Sep 17 00:00:00 2001 From: s-ol Date: Fri, 1 Nov 2019 13:47:09 +0100 Subject: add proper order handling, fsck for stores.fs --- build/fsck.moon | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 build/fsck.moon (limited to 'build') diff --git a/build/fsck.moon b/build/fsck.moon new file mode 100644 index 0000000..df882a9 --- /dev/null +++ b/build/fsck.moon @@ -0,0 +1,37 @@ +add = (tmpl) -> + package.path ..= ";#{tmpl}.lua" + package.moonpath ..= ";#{tmpl}.moon" + +add '?' +add '?.server' +add '?/init' +add '?/init.server' + +require 'mmm' + +import get_store from require 'mmm.mmmfs.stores' + +-- usage: +-- moon server.moon [FLAGS] [STORE] [host] [port] +-- * FLAGS - any of the following: +-- --[no-]rw - enable/disable POST?PUT/DELETE operations (default: on if local) +-- --[no-]unsafe - enable/disable server-side code execution when writable is on (default: on if local or --no-rw) +-- * STORE - see mmm/mmmfs/stores/init.moon:get_store +-- * host - interface to bind to (default localhost, set to 0.0.0.0 for public hosting) +-- * port - port to serve from, default 8000 + +flags = {} +arguments = for a in *arg + if flag = a\match '^%-%-no%-(.*)$' + flags[flag] = false + continue + elseif flag = a\match '^%-%-(.*)$' + flags[flag] = true + continue + else + a + +{ store, host, port } = arguments + +store = get_store store, verbose: true +store\fsck! -- cgit v1.2.3