Skip to content

Commit

Permalink
allow for multiple taps and targets in directory
Browse files Browse the repository at this point in the history
  • Loading branch information
JanKaul committed Mar 22, 2024
1 parent e5d3cd7 commit 2b2c798
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 2 additions & 4 deletions dashtool/src/build/build_dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,8 @@ pub(super) async fn build_dag<'repo>(
.await?;
}
Some(false) => {
let parent_path = Path::new(&path).parent().ok_or(Error::Anyhow(
anyhow!("target.json must be inside a subfolder."),
))?;
let tap_path = parent_path.join("tap.json");
let tap_path =
path.trim_end_matches("target.json").to_string() + "tap.json";
let tap_json: JsonValue =
serde_json::from_str(&fs::read_to_string(&tap_path)?)?;
let mut target_json: JsonValue =
Expand Down
5 changes: 1 addition & 4 deletions dashtool/src/build/update_dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ pub(super) fn update_dag(diff: &[Change], dag: Option<Dag>, branch: &str) -> Res
}

for path in singers {
let parent_path = Path::new(&path).parent().ok_or(Error::Anyhow(anyhow!(
"target.json must be inside a subfolder."
)))?;
let tap_path = parent_path.join("tap.json");
let tap_path = path.trim_end_matches("target.json").to_string() + "tap.json";
let tap_json: JsonValue = serde_json::from_str(&fs::read_to_string(&tap_path)?)?;
let mut target_json: JsonValue = serde_json::from_str(&fs::read_to_string(path)?)?;
target_json["branch"] = branch.to_string().into();
Expand Down

0 comments on commit 2b2c798

Please sign in to comment.