add_file¶
Operation used to add files to a project. This copies a file located in the qwikstart
repository (template_path) to a path relative to the working directory
(target_path).
Example¶
The following example uses the prompt operation to prompt the user for a name, and then uses it to generate a greeting message:
examples/operations/add_file.yml¶steps:
"Prompt for name":
name: prompt
inputs:
- name: "name"
"Add file example":
name: add_file
template_path: "templates/hello_world.txt"
target_path: "add_file.txt"
This example uses the following template (path relative to qwikstart definition file):
Hello, {{ qwikstart.name }}!
Note that template variables (in this case, name) default to using qwikstart as
a prefix, when rendered in templates. This can be controlled using the
template_variable_prefix option described below. By default, the prompt
operation adds variables to the template_variables namespace, which is used when
rendering the template.
Required context¶
target_pathFile path where rendered template will be saved. This will be relative to the current working directory.
template_pathPath to template file relative qwikstart repo directory, which is typically the directory containing the
qwikstart.ymlfile.
Optional context¶
template_variablesDictionary of variables available when rendering the file template.
template_variable_prefixdefault:
'qwikstart'Template variables will be nested in this namespace when rendering; e.g:
{{<template_variable_prefix>.your_template_variable}}