File System
File System plugin.
Available actions:
-> - write to file.
mkdir - create directory
rm - remove file or directory
mv - move file or directory
cp - copy file or directory
find - find files
Action Handler: Write to file
ID: com.fireblink.fbl.fs.file.write
Aliases:
fbl.fs.file.writefs.file.writefile.write->
Example 1: Define File Content Inline
->:
# [optional] file path, if not provided content will be written to temporary location directory.
# Note: all missing parent directories will be automatically created
path: /tmp/test.txt
# [optional]
# Note: required if "path" (above) and "assignPathTo" (below) is not provided.
assignPathTo: # follows common assign logic practicies https://fbl.fireblink.com/plugins/common#assign-to
# [optional]
# Note: required if "path" and "assignPathTo" (above) is not provided
pushPathTo: # follows common push logic practicies https://fbl.fireblink.com/plugins/common#push-to
# [required] content of the file
content: |-
test contentExample 2: Define File Content From Other File
->:
# [optional] file path, if not provided content will be written to temporary location directory.
# Note: all missing parent directories will be automatically created
path: /tmp/test.txt
# [optional]
# Note: required if "path" (above) and "assignPathTo" (below) is not provided.
assignPathTo: # follows common assign logic practicies https://fbl.fireblink.com/plugins/common#push-to
# [optional]
# Note: required if "path" and "assignPathTo" (above) is not provided
pushPathTo: # follows common push logic practicies https://fbl.fireblink.com/plugins/common#push-to
# [required] template file
# Note: global and then local EJS template processing will be applied to the template before writing
contentFromFile: /tmp/template.ejsAction Handler: Create Directories
Create directory (and all parent ones if missing).
ID: com.fireblink.fbl.fs.dir.create
Aliases:
fbl.fs.dir.createfs.dir.createdir.createmkdir -pmkdir
Example:
# create "child" directory
# if "parent" is missing it will be also created
mkdir: /tmp/parent/childAction Handler: Remove File or Directory
Removes file or directory for given path.
ID: com.fireblink.fbl.fs.remove
Aliases:
fbl.fs.removefbl.fs.rmfs.removefs.rmrm -rfremoverm
# remove "child"
rm: /tmp/parent/childAction Handler: Move File or Directory
Allows to move/rename file or entire directory.
ID: com.fireblink.fbl.fs.move
Aliases:
fbl.fs.movefbl.fs.mvfs.movefs.mvmovemv
Example 1: Move file to other folder
mv:
# move file.txt
from: /tmp/source/file.txt
# to "target" folder
# note: slash in the end is required if you want to specify a target folder
to: /tmp/target/Example 2: Move file to other folder and rename it
mv:
# move file.txt
from: /tmp/source/file.txt
# to "target" folder and rename it to "renamed.txt"
to: /tmp/target/renamed.txtExample 3: Move folder contents to other folder
mv:
# move everything from "source" folder
# note: slash in the end is required if you want to move folder contents rather then the folder itself
from: /tmp/source/
# to "target"
to: /tmp/targetAction Handler: Copy File or Directory
Allows to copy file or entire directory.
ID: com.fireblink.fbl.fs.copy
Aliases:
fbl.fs.copyfbl.fs.cpfs.copyfs.cpcopycp
Example 1: Copy file to other folder
cp:
# copy file.txt
from: /tmp/source/file.txt
# to "target" folder
# note: slash in the end is required if you want to specify a target folder
to: /tmp/target/Example 2: Copy file to other folder with different name
cp:
# copy file.txt
from: /tmp/source/file.txt
# to "target" folder and name it "renamed.txt"
to: /tmp/target/renamed.txtExample 3: Copy folder contents to other folder
cp:
# copy everything from "source" folder
# note: slash in the end is required if you want to copy folder contents rather then the folder itself
from: /tmp/source/
# to "target"
to: /tmp/targetAction Handler: Find Files
Find files by mask.
ID: com.fireblink.fbl.fs.find
Aliases:
fbl.fs.findfs.findfind
Example:
find:
# [required] list of masks to find files
include:
- /tmp/**/*.txt
# [optional] list of masks to exclude
exclude:
- /tmp/**/*.tmp.txt
# [required] result storage configuration
result:
# [optional] if provided all paths will be relative to give base directory
baseDir: /tmp
# [optional]
# Note: either `assignTo` or `pushTo` is requred
assignTo: # follows common assign logic practicies https://fbl.fireblink.com/plugins/common#push-to
# [optional]
# Note: either `assignTo` or `pushTo` is requred
pushTo: # follows common push logic practicies https://fbl.fireblink.com/plugins/common#push-toLast updated
Was this helpful?