MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / remove_lifecycle

Function remove_lifecycle

atomic-cli/src/commands/agent/lifecycle.rs:877–899  ·  view source on GitHub ↗
(dir: &Path, run_id: &str)

Source from the content-addressed store, hash-verified

875}
876
877fn remove_lifecycle(dir: &Path, run_id: &str) -> CliResult<()> {
878 validate_run_id(run_id)?;
879 match fs::remove_file(lifecycle_path(dir, run_id)) {
880 Ok(()) => {}
881 Err(e) if e.kind() == std::io::ErrorKind::NotFound => {}
882 Err(e) => {
883 return Err(CliError::Internal(anyhow!(
884 "failed to remove managed lifecycle '{}': {}",
885 run_id,
886 e
887 )))
888 }
889 }
890 match fs::remove_file(lifecycle_refusal_path(dir, run_id)) {
891 Ok(()) => Ok(()),
892 Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()),
893 Err(e) => Err(CliError::Internal(anyhow!(
894 "failed to remove managed lifecycle refusal '{}': {}",
895 run_id,
896 e
897 ))),
898 }
899}
900
901fn load_first_refusal(dir: &Path, run_id: &str) -> CliResult<Option<ManagedBoundaryRefusal>> {
902 validate_run_id(run_id)?;

Callers 1

runMethod · 0.85

Calls 4

validate_run_idFunction · 0.85
lifecycle_pathFunction · 0.85
lifecycle_refusal_pathFunction · 0.85
kindMethod · 0.45

Tested by

no test coverage detected