ferron

Ferron is a fast and simple static website generator made with Lua.
Log | Files | Refs | Submodules | README | LICENSE

commit bed468e232d3157459a0394f021ba7b70464c74d
parent f5357422a9d6cf122ce0636d631a6da888279dba
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Wed, 28 Mar 2018 22:18:56 -0400

Rename the set paths file.

Diffstat:
Mconfig.lua | 2+-
Mcornelius | 28++++++++++++++++------------
Aferron/setpaths.lua | 5+++++
Dset_paths.lua | 5-----
4 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/config.lua b/config.lua @@ -27,7 +27,7 @@ local config = { "dkjson", "markdown", "mimetypes", - "pegasus" + "pegasus" } } } diff --git a/cornelius b/cornelius @@ -2,21 +2,25 @@ -- Cornelius is the CLI of Ferron SSG and it's a WIP. -- <https://en.wikipedia.org/wiki/Cornelius_the_First> - local config = require "config" if arg[1] == "install" and tonumber(_VERSION:match("%d+%.%d+")) >= config.dependencies.lua then - -- First, check if luarocks is present in the env. - if pcall(require, "luarocks.loader") then - for i, dependency in ipairs(config.dependencies.modules) do - os.execute ("luarocks install --tree lua_modules " .. dependency) - end - else - print("Ferron needs Luarocks for installing his dependencies.") - print("Please install it on your system <https://luarocks.org/>.") - end + -- First, check if luarocks is present in the env. + if pcall(require, "luarocks.loader") then + -- Then install each dependency from the main configuration + for i, dependency in ipairs(config.dependencies.modules) do + os.execute ("luarocks install --tree lua_modules " .. dependency) + end + else + print("Ferron needs Luarocks for installing his dependencies.") + print("Please install it on your system https://luarocks.org/.") + end elseif arg[1] == "build" then - os.execute("lua -l set_paths ferron.lua") + os.execute("lua -l ferron.setpaths ferron.lua") elseif arg[1] == "build" and arg[2] == "--dev" then - os.execute("lua -l set_paths ferron.lua --dev") + os.execute("lua -l ferron.setpaths ferron.lua --dev") end + +-- install - install ferron and his dependencies +-- build - build site in prod or dev +-- create - create content from archetypes diff --git a/ferron/setpaths.lua b/ferron/setpaths.lua @@ -0,0 +1,5 @@ +-- setpaths.lua +local version = _VERSION:match("%d+%.%d+") + +package.path = 'lua_modules/share/lua/' .. version .. '/?.lua;lua_modules/share/lua/' .. version .. '/?/init.lua;' .. package.path +package.cpath = 'lua_modules/lib/lua/' .. version .. '/?.so;' .. package.cpath diff --git a/set_paths.lua b/set_paths.lua @@ -1,5 +0,0 @@ --- set_paths.lua -local version = _VERSION:match("%d+%.%d+") - -package.path = 'lua_modules/share/lua/' .. version .. '/?.lua;lua_modules/share/lua/' .. version .. '/?/init.lua;' .. package.path -package.cpath = 'lua_modules/lib/lua/' .. version .. '/?.so;' .. package.cpath