File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -131,11 +131,9 @@ fn main() {
131131 let mut bombadil =
132132 Bombadil :: from_settings ( Mode :: Gpg ) . unwrap_or_else ( |err| fatal ! ( "{}" , err) ) ;
133133
134- if !profiles. is_empty ( ) {
135- bombadil
136- . enable_profiles ( profiles. iter ( ) . map ( String :: as_str) . collect ( ) )
137- . unwrap_or_else ( |err| fatal ! ( "{}" , err) ) ;
138- }
134+ bombadil
135+ . enable_profiles ( profiles. iter ( ) . map ( String :: as_str) . collect ( ) )
136+ . unwrap_or_else ( |err| fatal ! ( "{}" , err) ) ;
139137
140138 bombadil. install ( ) . unwrap_or_else ( |err| fatal ! ( "{}" , err) ) ;
141139 }
@@ -196,11 +194,9 @@ fn main() {
196194 }
197195 . unwrap_or_else ( |err| fatal ! ( "{}" , err) ) ;
198196
199- if !profiles. is_empty ( ) {
200- bombadil
201- . enable_profiles ( profiles. iter ( ) . map ( String :: as_str) . collect ( ) )
202- . unwrap_or_else ( |err| fatal ! ( "{}" , err) ) ;
203- }
197+ bombadil
198+ . enable_profiles ( profiles. iter ( ) . map ( String :: as_str) . collect ( ) )
199+ . unwrap_or_else ( |err| fatal ! ( "{}" , err) ) ;
204200
205201 bombadil. print_metadata ( metadata_type) ;
206202 }
Original file line number Diff line number Diff line change @@ -233,6 +233,10 @@ impl Bombadil {
233233
234234 /// Enable a dotfile profile by merging its config with the default profile
235235 pub fn enable_profiles ( & mut self , profile_keys : Vec < & str > ) -> Result < ( ) > {
236+ if profile_keys. is_empty ( ) {
237+ return Ok ( ( ) ) ;
238+ }
239+
236240 let mut profiles: Vec < Profile > = profile_keys
237241 . iter ( )
238242 // unwrap here is safe cause allowed profile keys are checked by clap
You can’t perform that action at this time.
0 commit comments