Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/LuaNativeObjects.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Lua Native Objects
#

find_program(LUA_NATIVE_OBJECTS_EXECUTABLE native_objects.lua
find_program(LUA_NATIVE_OBJECTS_EXECUTABLE native_objects
PATHS ${CMAKE_SOURCE_DIR}/../LuaNativeObjects
DOC "LuaNativeObjects executable path")
set(USE_PRE_GENERATED_BINDINGS TRUE CACHE BOOL
Expand Down
11 changes: 7 additions & 4 deletions git2.nobj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,15 @@ subfiles {
--
-- Load parsed libgit2 docs.
--
local json = require"json"
local file = io.open("docs/libgit2.json", "r")
local libgit2_docs = json.decode(file:read("*a"))
local text = file:read("*a")
file:close()

local lg_funcs = libgit2_docs.functions
local ok, json = pcall(require, "json")
local lg_funcs = {}
if ok then
local libgit2_docs = json.decode(text)
lg_funcs = libgit2_docs.functions
end

-- Copy docs from libgit2
reg_stage_parser("pre_gen",{
Expand Down