use crate::config::global::BGitGlobalConfig;
use crate::config::local::{StepFlags, WorkflowRules};
use crate::workflows::default::prompt::pa07_ask_pull_push::AskPushPull;
use crate::{
bgit_error::BGitError,
step::{ActionStep, PromptStep, Step, Task::PromptStepTask},
};
pub(crate) struct IsPushedPulled {
name: String,
}
impl ActionStep for IsPushedPulled {
fn new() -> Self
where
Self: Sized,
{
IsPushedPulled {
name: "is_pushed_pulled".to_owned(),
}
}
fn get_name(&self) -> &str {
&self.name
}
fn execute(
&self,
_step_config_flags: Option<&StepFlags>,
_workflow_rules_config: Option<&WorkflowRules>,
_global_config: &BGitGlobalConfig,
) -> Result<Step, Box<BGitError>> {
Ok(Step::Task(PromptStepTask(Box::new(AskPushPull::new()))))
}
}