Trait dotfiles_core::action::ConditionalAction

source ·
pub trait ConditionalAction<'a>: Action<'a> {
    // Required method
    fn skip_in_ci(&self) -> bool;

    // Provided method
    fn check_conditions_and_execute(&self) -> Result<(), DotfilesError> { ... }
}
Expand description

Trait for actions to be skippable under certain conditions.

For now the only supported condition is whether to skip on CI environments.

Required Methods§

source

fn skip_in_ci(&self) -> bool

Whether to skip this action in Continuous Integration environments.

See is_running_in_ci()

Provided Methods§

source

fn check_conditions_and_execute(&self) -> Result<(), DotfilesError>

Checks that the conditions allow for executing this action, and if so executes it according to [execute(&self)].

If conditions don’t pass it simply skips and returns Ok(())

At this moment the only condition that is supported is whether the action should be skipped in CI, see [skip_in_ci(&self)].

Implementors§