Extract make_directory_for

This commit is contained in:
David Heinemeier Hansson
2023-01-23 10:37:19 +01:00
parent cd44014069
commit 148c43fe29
3 changed files with 11 additions and 7 deletions

View File

@@ -46,6 +46,14 @@ class Mrsk::Commands::Accessory < Mrsk::Commands::Base
).join(" "), host: host
end
def make_directory_for(local, remote)
if Pathname.new(local).exist?
[ :mkdir, "-p", Pathname.new(remote).dirname.to_s ]
else
raise "Missing file: #{local}"
end
end
def remove_files
[ :rm, "-rf", service_name ]
end