honeylisp/vendor/jeejah/bin/jeejah
Jeremy Penner c843deea3d git subrepo clone https://gitlab.com/technomancy/jeejah.git vendor/jeejah
subrepo:
  subdir:   "vendor/jeejah"
  merged:   "3ed9eb1"
upstream:
  origin:   "https://gitlab.com/technomancy/jeejah.git"
  branch:   "master"
  commit:   "3ed9eb1"
git-subrepo:
  version:  "0.4.2"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "65fde50"
2020-11-19 15:42:08 -05:00

36 lines
1 KiB
Lua
Executable file

#!/usr/bin/env lua
require "luarocks.loader"
local opts, port = {foreground = true}
for n,v in ipairs(arg) do
if(v == "--port") then
port = arg[n+1]
elseif(v == "--fennel") then
opts.fennel = true
elseif(v == "--debug") then
opts.debug = true
elseif(v == "--empty-sandbox") then
opts.sandbox = {}
elseif(v == "--version" or v == "--help") then
print("jeejah 0.2.0\n")
print("Options:")
print(" --fennel Start a Fennel server instead of Lua")
print(" --port Port on which to listen")
print(" --debug Print verbose debugging information")
os.exit(0)
end
end
local root_dir = debug.getinfo(1).source:sub(2, -(1+#"bin/jeejah"))
local search_parent = string.format("%s?.lua;%s", root_dir, package.path)
if(package.searchpath) then
local jeejah = dofile(package.searchpath("jeejah", search_parent))
jeejah.start(port, opts)
else -- 5.1
if root_dir == "" then root_dir = "." end
local jeejah = dofile(root_dir .. "/jeejah.lua")
jeejah.start(port, opts)
end