Skip to content

Latest commit

 

History

History
104 lines (70 loc) · 3.11 KB

destination.md

File metadata and controls

104 lines (70 loc) · 3.11 KB

Destination

The destination path.

Properties

Property Type Required Enum Default Description
conflict string "prompt"

Determines what to do when creating a new file and the destination path already exists.

content_type string

Specifies the content type of the file.

missing string "ignore"

Determines what to do when updating an existing file and the destination path is missing.

mode string "0666"

An optional POSIX mode to set on the file path.

path string

The file path relative to the destination directory.

conflict

Type Required Enum Default
string "prompt"

Determines what to do when creating a new file and the destination path already exists.

Important

Only used in create tasks.

Allowed Values:

  • "keep": Keep the existing path. The task becomes a noop.
  • "replace": Replace the existing path.
  • "prompt": Prompt the user.

content_type

Type Required Enum Default
string

Specifies the content type of the file. Inferred from the file extension by default.

When the content type is JSON or YAML, the file will be parsed into a data structure before use. When updating files, the content type determines the behavior of the match.pattern attribute.

Allowed Values:

  • "json"
  • "yaml"
  • "text"

missing

Type Required Enum Default
string "ignore"

Determines what to do when updating an existing file and the destination path is missing.

Important

Only used in update and delete tasks.

Allowed Values:

  • "ignore": Do nothing. The task becomes a noop.
  • "touch": Create an empty file.
  • "error": Raise an error.

mode

Type Required Enum Default
string "0666"

An optional POSIX mode to set on the file path.

Examples:

mode: "0755"
mode: '{{ .ModeValue }}'

path

Type Required Enum Default
string

The file path relative to the destination directory. Attempts to traverse outside the destination directory will raise a runtime error

When creating new files, the conflict attribute will be used if the path already exists. When updating or deleting files, the missing attribute will be used if the path does not exist.