Implement `file_append' task action
This commit is contained in:
1 parent
b1c7ff27b4
commit
387f37f3f5
6 files changed
+95
-3
No files matched your search
@@ -0,0 +1,23 @@
|
||||
module Producer
|
||||
module Core
|
||||
module Actions
|
||||
class FileAppend < Action
|
||||
def apply
|
||||
fs.file_write path, combined_content
|
||||
end
|
||||
|
||||
def path
|
||||
arguments[0]
|
||||
end
|
||||
|
||||
def content
|
||||
arguments[1]
|
||||
end
|
||||
|
||||
def combined_content
|
||||
fs.file_read(path) + content
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -13,9 +13,11 @@ module Producer
|
||||
define_action :echo, Actions::Echo
|
||||
define_action :sh, Actions::ShellCommand
|
||||
|
||||
define_action :mkdir, Actions::Mkdir
|
||||
define_action :file_write, Actions::FileWriter
|
||||
define_action :mkdir, Actions::Mkdir
|
||||
|
||||
define_action :file_append, Actions::FileAppend
|
||||
define_action :file_replace_content, Actions::FileReplaceContent
|
||||
define_action :file_write, Actions::FileWriter
|
||||
|
||||
attr_reader :env, :block, :actions
|
||||
|
||||
|
||||
Reference in new issue
Block a user