craftr.core.actions

craftr.core.actions.lambda_action

craftr.core.actions.write_file_action

WriteFileAction Objects

@dataclass
class WriteFileAction(Action)

file_path

The path of the file to write to.

text

The contents of the file as text.

encoding

The encoding if text is provided.

data

The contents of the file to write as binary data.

craftr.core.actions.create_directory_action

CreateDirectoryAction Objects

@dataclass
class CreateDirectoryAction(Action)

path

The path of the directory to create.

craftr.core.actions.command_action

CommandAction Objects

@dataclass
class CommandAction(Action)

command

A command line to execute.

commands

A list of command lines to execute in order. If both command and commands are specified, command is executed first.

working_directory

The working directory in which to execute the command(s).

verbose

If this is enabled, the command that is being run is printed to stdout.

craftr.core.actions.action

Action Objects

class Action(, metaclass=abc.ABCMeta)

as_task

 | @classmethod
 | as_task(cls, project: 'Project', name: str) -> 'DefaultTask'

Factory function to produce a task that contains exactly the properties of this action through the class annotations. The action will be created by passing a keyword argument for every populated property value.