From ffcb43df8f39a55be468cf4bdfecd72dd026d940 Mon Sep 17 00:00:00 2001 From: diogo464 Date: Fri, 24 Dec 2021 21:01:11 +0000 Subject: initial implementation of status command closes #1 --- dotup_cli/src/utils.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'dotup_cli/src/utils.rs') diff --git a/dotup_cli/src/utils.rs b/dotup_cli/src/utils.rs index a5c7647..be9f3a9 100644 --- a/dotup_cli/src/utils.rs +++ b/dotup_cli/src/utils.rs @@ -149,3 +149,14 @@ pub fn collect_files_in_dir(dir: impl Into) -> anyhow::Result, +) -> anyhow::Result<(Vec, Vec)> { + Ok(std::fs::read_dir(dir)? + .filter_map(|e| e.ok()) + .map(|e| e.path()) + .partition(|p| p.is_dir())) +} -- cgit