File operations nano-sched plugin
- opts
<Object>
options object- sources_folder
<String>
- dist_folder
<String>
- sources_folder
- name
<String>
- dest
<String>
(Optional) - encoding
<String>
- content
<any>
Load file from <options.sources_folder>/<data.name>
to the data.content with <data.encoding>='utf8'
.
Load file from <options.sources_folder>/<data.name>
to the data.content with <data.encoding>=null
.
Load file from <options.sources_folder>/<data.name>
and parse to the data.content with <data.encoding>='json'
.
Will cancels job if destination file exists.
Generate destination file name by <data.dest>
template. The template can contains of shortcuts for
sources file name parts:
- \1 -- path to source name
- \2 -- name of file
- \3 -- extension of file
For example, for data.name = 'blah/foo.bar'
and data.dest = 'folder/\2\3'
will generated a new
data.dest
value 'folder/foo.bar'
.
Save data.content to <options.dist_folder>/<data.dest || data.name>
with encoding <data.encoding>
('utf8','json',null).
Copy file from <options.sources_folder>/<data.name>
to <options.dist_folder>/<data.dest || data.name>
.