lib/percheron/actions/purge.rb in percheron-0.6.3 vs lib/percheron/actions/purge.rb in percheron-0.6.4
- old
+ new
@@ -7,13 +7,14 @@
def initialize(container)
@container = container
end
def execute!
- stop!
- delete_container! if container.exists?
- delete_image! if container.image_exists?
- container
+ results = []
+ results << stop!
+ results << delete_container! if container.exists?
+ results << delete_image! if container.image_exists?
+ results.compact.empty? ? nil : container
end
private
attr_reader :container