Skip to content

Commit

Permalink
fix: builder require commented codes
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoDornelles committed Nov 5, 2024
1 parent 64b2cfd commit 11f9d47
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/cli/commands/build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ local function build(args)

-- combine files
if #bundler > 0 then
zeebo_bundler.build(dist..bundler, 'main.lua', dist..'main.lua')
zeebo_bundler.build(dist..bundler, 'game.lua', dist..'game.lua')
if core.src then
zeebo_bundler.build(dist..bundler, 'main.lua', dist..'main.lua')
end
if args.game then
zeebo_bundler.build(dist..bundler, 'game.lua', dist..'game.lua')
end
zeebo_fs.clear(dist..bundler)
zeebo_fs.rmdir(dist..bundler)
end
Expand Down
6 changes: 6 additions & 0 deletions src/lib/cli/builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ local function move(src_filename, out_filename, prefix)
local out_file = src_file and io.open(out_filename, 'w')
local pattern_require = 'local ([%w_%-]+) = require%([\'"]([%w_/-]+)[\'"]%)'
local pattern_gameload = 'std%.node%.load%([\'"](.-)[\'"]%)'
local pattern_comment = '^--!'

if src_file and out_file then
repeat
local line = src_file:read()

if line and line:find(pattern_comment) then
line = ''
end

if line then
local line_require = { line:match(pattern_require) }
local node_require = { line:match(pattern_gameload) }
Expand Down
4 changes: 2 additions & 2 deletions tools/ci_luau-analyze.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ end

cmd('./cli.sh build --bundler --core '..core)
cmd(replace..' --format "function native_callback" --replace "local function _native_callback"')
cmd('./cli.sh tool-package-del dist/main.lua third_party_json_rxi')
cmd('./cli.sh tool-package-del dist/main.lua lib_engine_api_encoder')
cmd('./cli.sh tool-package-del dist/main.lua core_src_third_party_json_rxi')
cmd('./cli.sh tool-package-del dist/main.lua core_src_lib_engine_api_encoder')

0 comments on commit 11f9d47

Please sign in to comment.