From f13a60805df476649e908842f78785ccf47834ed Mon Sep 17 00:00:00 2001 From: diogo464 Date: Fri, 9 Jul 2021 04:15:11 -0400 Subject: Allow linking directories. --- dotup_cli/src/commands/link.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'dotup_cli/src') diff --git a/dotup_cli/src/commands/link.rs b/dotup_cli/src/commands/link.rs index bed3744..614c0ca 100644 --- a/dotup_cli/src/commands/link.rs +++ b/dotup_cli/src/commands/link.rs @@ -24,7 +24,13 @@ pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { }; if let Some(destination) = destination { - for path in collect_file_type(origins, FileType::File)? { + let collected_paths = if opts.directory { + origins.to_vec() + } else { + collect_file_type(origins, FileType::File)? + }; + + for path in collected_paths { let link_desc = LinkCreateParams { origin: path, destination: destination.clone(), -- cgit