@@ -2,7 +2,7 @@ private_lua_ship_machine_methods.save_to_file = function(self_obj, filename)
22 private_lua_ship .open (filename , " w" ):write (self_obj .docker_file ):close ()
33end
44
5- private_lua_ship_machine_methods .build = function (self_obj , name )
5+ private_lua_ship_machine_methods .build = function (self_obj , name )
66 if not name then
77 name = " sha" .. private_lua_ship .sha256 (self_obj .docker_file )
88 end
@@ -16,35 +16,36 @@ private_lua_ship_machine_methods.build = function(self_obj, name)
1616 private_lua_ship .os_remove (filename )
1717 return name
1818end
19- private_lua_ship_machine_methods .start = function (self_obj ,props )
19+ private_lua_ship_machine_methods .start = function (self_obj , props )
2020 if not props .rebuild then
21- props .rebuild = true
22- end
21+ props .rebuild = true
22+ end
2323 local name = props .name
2424 if props .rebuild then
25-
26- name = private_lua_ship_machine_methods .build (self_obj ,props .name )
25+ name = private_lua_ship_machine_methods .build (self_obj , props .name )
2726 end
2827 if not props .flags then
2928 props .flags = {}
3029 end
3130 local command = self_obj .provider .. " run "
32- for i = 1 , # props .flags do
31+ for i = 1 , # props .flags do
3332 local current_flag = props .flags [i ]
34- command = command .. current_flag .. " "
35-
33+ command = command .. current_flag .. " "
3634 end
3735
3836 if not props .volumes then
3937 props .volumes = {}
4038 end
41- for i = 1 , # props .volumes do
39+ for i = 1 , # props .volumes do
4240 local current_volume = props .volumes [i ]
43- command = command .. " -v " .. current_volume [1 ].. " :" .. current_volume [2 ].. " :z "
41+ command = command .. " -v " .. current_volume [1 ] .. " :" .. current_volume [2 ] .. " :z "
4442 end
4543 command = command .. name
44+ if props .command then
45+ command = command .. " " .. props .command
46+ end
4647 local ok = private_lua_ship .os_execute (command )
4748 if not ok then
4849 private_lua_ship .error (" unable to execute command:\n " .. command )
4950 end
50- end
51+ end
0 commit comments