diff options
| author | diogo464 <[email protected]> | 2021-07-09 04:15:11 -0400 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2021-07-09 04:15:11 -0400 |
| commit | f13a60805df476649e908842f78785ccf47834ed (patch) | |
| tree | 486d5d93e7876248aae1bd853b4977eb7f432cd4 /dotup_cli/src/commands/link.rs | |
| parent | e1df098c885bda5cd0b375cb46c460367abe4f17 (diff) | |
Allow linking directories.
Diffstat (limited to 'dotup_cli/src/commands/link.rs')
| -rw-r--r-- | dotup_cli/src/commands/link.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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<()> { | |||
| 24 | }; | 24 | }; |
| 25 | 25 | ||
| 26 | if let Some(destination) = destination { | 26 | if let Some(destination) = destination { |
| 27 | for path in collect_file_type(origins, FileType::File)? { | 27 | let collected_paths = if opts.directory { |
| 28 | origins.to_vec() | ||
| 29 | } else { | ||
| 30 | collect_file_type(origins, FileType::File)? | ||
| 31 | }; | ||
| 32 | |||
| 33 | for path in collected_paths { | ||
| 28 | let link_desc = LinkCreateParams { | 34 | let link_desc = LinkCreateParams { |
| 29 | origin: path, | 35 | origin: path, |
| 30 | destination: destination.clone(), | 36 | destination: destination.clone(), |
