-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathrunner.lua
More file actions
45 lines (38 loc) · 856 Bytes
/
runner.lua
File metadata and controls
45 lines (38 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
local async = require('java-core.utils.async').sync
local get_error_handler = require('java.handlers.error')
local Runner = require('java.runner.runner')
local M = {
built_in = {},
---@type java.Runner
runner = Runner(),
}
--- @param opts {}
function M.built_in.run_app(opts)
async(function()
M.runner:start_run(opts.args)
end)
.catch(get_error_handler('Failed to run app'))
.run()
end
function M.built_in.toggle_logs()
async(function()
M.runner:toggle_open_log()
end)
.catch(get_error_handler('Failed to run app'))
.run()
end
function M.built_in.switch_app()
async(function()
M.runner:switch_log()
end)
.catch(get_error_handler('Failed to switch run'))
.run()
end
function M.built_in.stop_app()
async(function()
M.runner:stop_run()
end)
.catch(get_error_handler('Failed to stop run'))
.run()
end
return M