Implement `mkdir' task action

This commit is contained in:
Thibault Jouan
2014-01-21 15:50:07 +00:00
parent f147ce7d65
commit 7f5d1a4085
9 changed files with 75 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
module Producer
module Core
module Actions
class Mkdir < Action
def apply
fs.mkdir path
end
def path
arguments.first
end
end
end
end
end

View File

@@ -26,6 +26,10 @@ module Producer
false
end
def mkdir(path)
sftp.mkdir! path
end
def file_write(path, content)
sftp.file.open path, 'w' do |f|
f.write content

View File

@@ -13,6 +13,7 @@ module Producer
define_action :echo, Actions::Echo
define_action :sh, Actions::ShellCommand
define_action :mkdir, Actions::Mkdir
define_action :file_write, Actions::FileWriter
attr_reader :env, :block, :actions