File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,13 @@ use tokio::process::Command;
24
24
#[ command( version = "1.0" , author = "Serokell <https://serokell.io/>" ) ]
25
25
pub struct Opts {
26
26
/// The flake to deploy
27
- #[ arg( group = "deploy" ) ]
28
27
target : Option < String > ,
29
28
30
29
/// A list of flakes to deploy alternatively
31
- #[ arg( long, group = "deploy" ) ]
30
+ #[ arg( long) ]
32
31
targets : Option < Vec < String > > ,
33
32
/// Treat targets as files instead of flakes
34
- #[ clap ( short, long) ]
33
+ #[ arg ( short, long) ]
35
34
file : Option < String > ,
36
35
/// Check signatures when using `nix copy`
37
36
#[ arg( short, long) ]
@@ -677,10 +676,20 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> {
677
676
error ! ( "Cannot use both --dry-activate & --boot!" ) ;
678
677
}
679
678
680
- let deploys = opts
681
- . clone ( )
682
- . targets
683
- . unwrap_or_else ( || vec ! [ opts. clone( ) . target. unwrap_or_else( || "." . to_string( ) ) ] ) ;
679
+ let deploys;
680
+ if opts. targets . is_some ( ) && opts. target . is_some ( ) {
681
+ // SAFETY: checked before
682
+ let mut targets = opts. targets . unwrap ( ) ;
683
+ targets. push ( opts. target . unwrap ( ) ) ;
684
+ deploys = targets;
685
+ } else {
686
+ deploys = opts
687
+ . clone ( )
688
+ . targets
689
+ . unwrap_or_else ( || vec ! [ opts. clone( ) . target. unwrap_or_else( || "." . to_string( ) ) ] ) ;
690
+ }
691
+
692
+ debug ! ( "Deploying the following configurations {:?}" , deploys) ;
684
693
685
694
let deploy_flakes: Vec < DeployFlake > =
686
695
if let Some ( file) = & opts. file {
You can’t perform that action at this time.
0 commit comments