New API

Warning

This feature is experimental and subject to breaking changes. See the Conan stability section for more information.

Warning

Subapis must not be initialized by themselves. They are intended to be accessed only through the main ConanAPI attributes.

class NewAPI(conan_api)
save_template(template: str, defines=None, output_folder=None, force=False)

Save the template files in the output_folder, replacing the template variables with the defines

Parameters:
  • template – The template to use: a path to a folder containing the template files (absolute or relative to the current working directory), or the name of a template, either those available under <conan_home>/templates/command/new/<template> or the built-in ones

  • defines – A list with the k=v variables to replace in the template

  • output_folder – The folder where the template files will be saved, cwd if None

  • force – If True, overwrite the files if they already exist, otherwise raise an error