-
-
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) · 857 Bytes
/
runner.lua
File metadata and controls
45 lines (38 loc) · 857 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 runner = require('async.runner')
local get_error_handler = require('java-core.utils.error_handler')
local Runner = require('java-runner.runner')
local M = {
built_in = {},
---@type java.Runner
runner = Runner(),
}
--- @param opts {}
function M.built_in.run_app(opts)
runner(function()
M.runner:start_run(opts.args)
end)
.catch(get_error_handler('Failed to run app'))
.run()
end
function M.built_in.toggle_logs()
runner(function()
M.runner:toggle_open_log()
end)
.catch(get_error_handler('Failed to run app'))
.run()
end
function M.built_in.switch_app()
runner(function()
M.runner:switch_log()
end)
.catch(get_error_handler('Failed to switch run'))
.run()
end
function M.built_in.stop_app()
runner(function()
M.runner:stop_run()
end)
.catch(get_error_handler('Failed to stop run'))
.run()
end
return M