Commands should do all the actual work

This commit is contained in:
David Heinemeier Hansson
2023-01-23 10:35:22 +01:00
parent 1bcc65bc56
commit cd44014069
2 changed files with 5 additions and 1 deletions

View File

@@ -104,6 +104,6 @@ class Mrsk::Cli::Accessory < Mrsk::Cli::Base
desc "remove_files [NAME]", "Remove accessory directory used for uploaded files from host"
def remove_files(name)
accessory = MRSK.accessory(name)
on(accessory.host) { execute :rm, "-rf", accessory.service_name }
on(accessory.host) { execute *accessory.remove_files }
end
end

View File

@@ -46,6 +46,10 @@ class Mrsk::Commands::Accessory < Mrsk::Commands::Base
).join(" "), host: host
end
def remove_files
[ :rm, "-rf", service_name ]
end
def remove_container
docker :container, :prune, "-f", *service_filter
end