Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split the API from the script #4

Closed
MisterDA opened this issue May 28, 2016 · 1 comment
Closed

Split the API from the script #4

MisterDA opened this issue May 28, 2016 · 1 comment

Comments

@MisterDA
Copy link

Hi !
This is a very useful tool, and I'd like to use it from a Lua application. Perhaps you could split the API (as a module) from the main script ? That would allow to simply do something like:

local static = require 'luastatic'
static.compile("main.lua", "require1.lua")

Because for now I have to call the script with os.execute(), and that's not very convenient.

Thank you !

@ers35
Copy link
Owner

ers35 commented Feb 4, 2017

Does this meet your use case?

-- luastatic.lua
local function luastatic(...)
  os.execute(table.concat({"luastatic", ...}, " "))
end

return luastatic
local luastatic = require("luastatic")
luastatic("main.lua", "/usr/lib/x86_64-linux-gnu/liblua5.2.a", "-I/usr/include/lua5.2")

@ers35 ers35 closed this as completed Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants