Skip to main content

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​

FlagRequiredDescriptionDefault
<functionName>YesFunction name—
[destPath]NoDestination pathThe functionRoot directory
--fn-version <version>NoFunction 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-version or with $LATEST, the latest code is downloaded
  • --fn-version accepts only $LATEST or a published positive integer, anything else fails immediately
  • A published version without destPath is 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 the functionRoot directory in a folder named after the function