tcb fn code download
Downloads the code of a deployed function. Function configuration is not touched.
Usage
tcb fn code download <functionName> [destPath] [options]
Flags
| Flag | Required | Description | Default |
|---|---|---|---|
<functionName> | Yes | Function name | — |
[destPath] | No | Destination path | The functionRoot directory |
--fn-version <version> | No | Function version, either $LATEST or a published positive integer | $LATEST |
Example
# Download $LATEST to the default directory
tcb fn code download app
# Download to a specific directory
tcb fn code download app ./my-functions/app
# Download version 1 to a specific directory
tcb fn code download app ./my-functions/app-v1 --fn-version 1
# Download version 1, written to <functionRoot>/<name>-v1/
tcb fn code download app --fn-version 1
# Quote $LATEST to keep the shell from expanding it
tcb fn code download app --fn-version '$LATEST'
Version rules
- Without
--fn-versionor with$LATEST, the latest code is downloaded --fn-versionaccepts only$LATESTor a published positive integer, anything else fails immediately- A published version without
destPathis written to<functionRoot>/<name>-v<version>/, keeping it apart from the default directory - A missing version reports the available versions of that function
- Without
destPath, code goes to thefunctionRootdirectory in a folder named after the function
Related commands
- Update function code: replace the cloud code only
- List versions: versions available for download
- Deploy a function: update code, configuration, and triggers together