Extract xargs helper
This commit is contained in:
@@ -28,7 +28,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def stop
|
def stop
|
||||||
pipe current_container_id, "xargs docker stop"
|
pipe current_container_id, xargs(docker(:stop))
|
||||||
end
|
end
|
||||||
|
|
||||||
def info
|
def info
|
||||||
@@ -83,7 +83,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
|||||||
def remove_container(version:)
|
def remove_container(version:)
|
||||||
pipe \
|
pipe \
|
||||||
container_id_for(container_name: service_with_version(version)),
|
container_id_for(container_name: service_with_version(version)),
|
||||||
[ "xargs", docker(:container, :rm) ].flatten
|
xargs(docker(:container, :rm))
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_containers
|
def remove_containers
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ module Mrsk::Commands
|
|||||||
combine *commands, by: "|"
|
combine *commands, by: "|"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def xargs(command)
|
||||||
|
[ :xargs, command ].flatten
|
||||||
|
end
|
||||||
|
|
||||||
def docker(*args)
|
def docker(*args)
|
||||||
args.compact.unshift :docker
|
args.compact.unshift :docker
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user