From 1f2d11c0ee5d59715106ca8a4354ea2dd250f04d Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 1 Sep 2023 17:43:19 +0100 Subject: [PATCH] Locate VHOST files This code is obviously not sensible as it's not async --- src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main.rs b/src/main.rs index 6ea5cdf..3a3f748 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,6 +36,18 @@ fn get_dokku_root() -> Option { } async fn hosts(State(state): State) -> String { + for vhost in state + .dokku_root + .read_dir() + .unwrap() + .filter_map(Result::ok) + .map(|entry| entry.path()) + .filter(|path| path.is_dir()) + .map(|path| path.join("VHOST")) + .filter(|path| path.is_file()) + { + dbg!(vhost); + } format!("{}", state.dokku_root.display()) }