commit 7db6ca70267b0d207b0cad345bf8ae202ab98726
parent 8716cf28c1d23e41b37751ac1e3736e259c84700
Author: Hugo Soucy <hugo@soucy.cc>
Date: Tue, 28 Mar 2023 12:41:50 -0400
Modify the add script
Diffstat:
1 file changed, 21 insertions(+), 0 deletions(-)
diff --git a/bin/add b/bin/add
@@ -3,10 +3,13 @@ do
--
package.path = package.path .. ';'.. arg[0]:match("(.*/)") ..'/?.lua'
--
+ local inspect = require 'inspect'
+
local lustache = require 'lustache'
local file = require 'satelito.file'
local slugify = require 'satelito.lib.slugify'
+ local content_model
local content_title
local content_url
local content_lua_file
@@ -16,6 +19,24 @@ do
local content_name
local content_dir
+ repeat
+ local model_path;
+
+ io.write('Please enter the model of the page: \n')
+ io.flush()
+
+ --find . -name "a-propos.lua"
+
+ content_model=io.read()
+
+ tostring(content_model)
+
+ model_path = os.execute("find . -name ".. content_model)
+
+ print(model_path)
+
+ until string.len(content_model) > 0
+
-- Set the TITLE of the page
repeat
io.write('Please enter the title of the page: \n')