Skip to content

Commit f5a64b8

Browse files
update on quite mode
1 parent 1f9943f commit f5a64b8

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

src/private_lua_ship.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
private_lua_ship.create_machine = function(start_image)
22
local self_obj = {}
3+
self_obj.quiet = true
34
self_obj.provider = "docker"
45
self_obj.docker_file = "FROM " .. start_image .. "\n"
56
self_obj.cache_folder = "/tmp"

src/private_machine_methods/cli_iteraction.lua

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,24 @@ private_lua_ship_machine_methods.build = function(self_obj, name)
88
end
99
local filename = self_obj.cache_folder .. "/" .. name .. ".Dockerfile"
1010
private_lua_ship_machine_methods.save_to_file(self_obj, filename)
11-
local command = self_obj.provider .. " build -t " .. name .. " -f " .. filename .. " . --quiet "
11+
12+
local quiet = ""
13+
if self_obj.quiet then
14+
quiet = " --quiet "
15+
end
16+
17+
18+
local command = self_obj.provider .. " build -t " .. name .. " -f " .. filename .. " . " .. quiet
1219
local ok = private_lua_ship.os_execute(command)
1320
if not ok then
1421
private_lua_ship.error("unable to execute command:\n" .. command)
1522
end
1623
private_lua_ship.os_remove(filename)
1724
return name
1825
end
19-
private_lua_ship_machine_methods.start = function(self_obj, props)
26+
27+
28+
private_lua_ship_machine_methods.create_start_command = function(self_obj, props)
2029
if not props.rebuild then
2130
props.rebuild = true
2231
end
@@ -66,6 +75,15 @@ private_lua_ship_machine_methods.start = function(self_obj, props)
6675

6776
command = command .. ' sh -c "' .. formmated .. '"'
6877
end
78+
end
79+
80+
81+
private_lua_ship_machine_methods.start = function(self_obj, props)
82+
local command = private_lua_ship_machine_methods.create_start_command(self_obj, props)
83+
if not command then
84+
private_lua_ship.error("unable to create start command")
85+
end
86+
6987
local ok = private_lua_ship.os_execute(command)
7088
if not ok then
7189
private_lua_ship.error("unable to execute command:\n" .. command)

0 commit comments

Comments
 (0)