forked from FakeBuild/Xake
-
Notifications
You must be signed in to change notification settings - Fork 0
Tasks | Cp
olegz edited this page Mar 16, 2026
·
6 revisions
Copies files, directories, and filesets to another location.
copyis an alias forcp.
do! cp {file "bin/*.exe"; todir "deploy"}The
fileoption accepts file masks.
Recursively copies a directory and its contents, preserving folder structure:
do! cp {dir "bin"; todir "deploy"}This creates deploy/bin/....
Copies files without preserving directory structure:
do! cp {dir "bin"; todir "deploy"; flatten}
flattenis automatically enabled when usingfile.
The most flexible way to define copy behavior:
do! cp {
files (fileset {
basedir "bin"
includes "*.exe"
includes "*.dll"
})
todir "deploy"
}cp preserves directory structure relative to the fileset's basedir.
| Operation | Description |
|---|---|
file "mask" |
Copy files matching the mask |
dir "path" |
Copy a directory recursively |
files fileset |
Copy files from a fileset |
todir "path" |
Target directory |
flatten |
Do not preserve directory structure |
verbose |
Log each copied file |
overwrite |
Overwrite existing files |
dryrun |
Log without copying |
Copies a single file to a specific path:
do! copyFile "src/App.config" "bin/App.exe.config"Copies a file to the current target:
"bin/app.config" ..> copyFrom "src/App.config"