lib/takeltau/ship/project/start.rb in takeltau-0.45.17 vs lib/takeltau/ship/project/start.rb in takeltau-0.45.19
- old
+ new
@@ -1,11 +1,11 @@
# frozen_string_literal: true
# tau ship project start
module ShipProjectStart
# Start a takelship
- def ship_project_start(project)
+ def ship_project_start(project, mute: false)
return false unless _ship_project_start_matrjoschka?
takelship = _ship_info_lib_get_takelshipinfo
unless takelship
log.debug 'Unable to gather takelship info'
@@ -21,11 +21,11 @@
log.debug 'Writing port configuration to takelage.yml'
_ship_ports_lib_write_ports(ports, project)
log.debug "Starting takelship project \"#{project}\""
ship_status = _ship_container_lib_docker_privileged ports, project
- return false unless _ship_container_lib_started? ship_status
+ return false unless _ship_container_lib_started?(ship_status, mute)
_ship_project_start_print_banner project
say
_ship_project_start_print_ports ports
true
@@ -60,14 +60,14 @@
say 'Try: ship project list'
false
end
# check if the ship started successfully
- def _ship_container_lib_started?(ship_status)
+ def _ship_container_lib_started?(ship_status, mute)
return true if ship_status[2].zero?
- say 'Unable to start the takelship. The error message was:'
- say ship_status[1].to_s.strip.delete_prefix('"').delete_suffix('"')
+ say 'Unable to start the takelship. The error message was:' unless mute
+ say ship_status[1].to_s.strip.delete_prefix('"').delete_suffix('"') unless mute
false
end
# print banner with status information
def _ship_project_start_print_banner(project)