Implement `file_append' task action
This commit is contained in:
23
lib/producer/core/actions/file_append.rb
Normal file
23
lib/producer/core/actions/file_append.rb
Normal file
@@ -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
|
Reference in New Issue
Block a user