|
spudplate
Template scaffolding compiler for spudlang .spud files
|
Copies the contents of <source> into an already-existing <destination> directory. Errors if the destination does not exist.
copy is the right tool when you want to merge content into a directory you have already created. It complements mkdir from, which creates a new directory and populates it.
| Goal | Statement |
|---|---|
| Create a directory and populate it from one source | mkdir <path> from <source> |
| Add more content into a directory you already created | copy <source> into <existing_path> |
| Clause | Effect |
|---|---|
verbatim | Suppress {ident} substitution in copied file contents |
when | Skip the copy if the condition is false |
The aliased path (template_path) is the conventional way to write this: declare the destination once, then merge content into it from multiple sources.
{ident} substitution is applied to copied file contents by default. Function calls, arithmetic, or string concatenation inside braces are not supported in source-file contents (only in content expressions). To skip substitution entirely, add verbatim:
Binary files in the source tree are auto-detected and copied verbatim regardless.
copy errors if <destination> does not exist. Use mkdir (or mkdir from) first.
This is intentional: copy is for layering content. If you want a fresh directory populated from one source, mkdir from is the right statement.
A when-gated copy lets you compose a directory from optional pieces:
Only one of the language-specific copies runs, but all three can sit unconditionally in the source.
<source> and <destination>.