Skip to content

Commit

Permalink
load_config_file_sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Evanfeenstra committed Dec 10, 2024
1 parent b63dc28 commit 9951a9c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,15 @@ async fn file_exists(file: &str) -> bool {

const YAML: bool = true;

pub fn load_config_file_sync(project: &str) -> Result<Stack> {
match tokio::runtime::Handle::try_current() {
Ok(handle) => handle.block_on(load_config_file(project)),
Err(_) => tokio::runtime::Runtime::new()
.unwrap()
.block_on(load_config_file(project)),
}
}

pub async fn load_config_file(project: &str) -> Result<Stack> {
let path = format!("vol/{}/config.json", project);
if !YAML {
Expand Down

0 comments on commit 9951a9c

Please sign in to comment.