Skip to content

Commit

Permalink
chore: 增加调试时对绝对路径manifest的检查
Browse files Browse the repository at this point in the history
  • Loading branch information
Cnotech committed Nov 11, 2023
1 parent d87c356 commit 00ec1af
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/entrances/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::types::package::GlobalPackage;
use crate::types::steps::Step;
use crate::types::verifiable::Verifiable;
use crate::types::workflow::WorkflowNode;
use crate::utils::is_starts_with_inner_value;
use crate::{log, log_ok_last, p2s};
use anyhow::{anyhow, Result};
use std::fs::read_dir;
Expand All @@ -16,6 +17,18 @@ fn get_manifest(flow: Vec<WorkflowNode>, fs: &mut MixedFS) -> Vec<String> {
for node in flow {
manifest.append(&mut node.body.get_manifest(fs));
}
debug_assert!(manifest.clone().into_iter().fold(true, |state, cur| {
if !state {
state
} else {
if is_starts_with_inner_value(&cur) {
log!("Error:Fatal:Got absolute manifest '{cur}'");
false
} else {
true
}
}
}));
manifest
}

Expand Down

0 comments on commit 00ec1af

Please sign in to comment.