Engine 0.0.6
Game engine in lua
Loading...
Searching...
No Matches
cli.lua
Go to the documentation of this file.
1local os = require('os')
2
3local zeebo_fs = require('src/lib/cli/fs')
4local zeebo_bundler = require('src/lib/cli/bundler')
5local zeebo_bootstrap = require('src/lib/cli/bootstrap')
6
7local function cli_test(args)
8 local coverage = args.coverage and '-lluacov' or ''
9 local files = zeebo_fs.ls('./tests')
10 local index = 1
11 local ok = true
12 while index <= #files do
13 ok = ok and os.execute('lua '..coverage..' ./tests/'..files[index])
14 index = index + 1
15 end
16 if #coverage > 0 then
17 os.execute('luacov src')
18 os.execute('tail -n '..tostring(#files + 5)..' luacov.report.out')
19 end
20 return ok
21end
22
23local function cli_build(args)
24 local dist = args.dist
25 zeebo_fs.clear(dist)
26 zeebo_bundler.build('src/cli/', 'main.lua', dist..'main.lua')
27 local ok, message = zeebo_bootstrap.build(dist..'main.lua', dist..'cli.lua', './src', './assets', './examples', './mock')
28 os.remove(dist..'main.lua')
29 return ok, message
30end
31
32local function cli_dump(args)
33 return zeebo_bootstrap.dump(dist)
34end
35
36local P = {
37 ['cli-build'] = cli_build,
38 ['cli-test'] = cli_test,
39 ['cli-dump'] = cli_dump
40}
41
42return P
local function bundler(args)
local zeebo_bundler
Definition cli.lua:4
local function cli_test(args)
local function cli_dump(args)
local zeebo_bootstrap
Definition cli.lua:5
local function cli_build(args)
local zeebo_fs
Definition cli.lua:3
local os
Definition cli.lua:1
local function bootstrap()
local function require(std, game, application)
local function ls(src_path)
local ok
Definition main.lua:40
local message
Definition main.lua:40