File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -463,13 +463,16 @@ impl Devenv {
463
463
skip( self ) ,
464
464
fields( devenv. user_message = format!( "Building {name} container" ) )
465
465
) ]
466
- pub async fn container_build ( & self , name : & str ) -> Result < String > {
466
+ pub async fn container_build ( & mut self , name : & str ) -> Result < String > {
467
467
if cfg ! ( target_os = "macos" ) {
468
468
bail ! (
469
469
"Containers are not supported on macOS yet: https://github.com/cachix/devenv/issues/430"
470
470
) ;
471
471
}
472
472
473
+ // This container name is passed to the flake as an argument and tells the module system
474
+ // that we're 1. building a container 2. which container we're building.
475
+ self . container_name = Some ( name. to_string ( ) ) ;
473
476
self . assemble ( false ) . await ?;
474
477
475
478
let sanitized_name = sanitize_container_name ( name) ;
@@ -489,7 +492,7 @@ impl Devenv {
489
492
}
490
493
491
494
pub async fn container_copy (
492
- & self ,
495
+ & mut self ,
493
496
name : & str ,
494
497
copy_args : & [ String ] ,
495
498
registry : Option < & str > ,
@@ -540,7 +543,7 @@ impl Devenv {
540
543
}
541
544
542
545
pub async fn container_run (
543
- & self ,
546
+ & mut self ,
544
547
name : & str ,
545
548
copy_args : & [ String ] ,
546
549
registry : Option < & str > ,
Original file line number Diff line number Diff line change @@ -108,8 +108,6 @@ async fn main() -> Result<()> {
108
108
name,
109
109
command,
110
110
} => {
111
- devenv. container_name = name. clone ( ) ;
112
-
113
111
// Backwards compatibility for the legacy container flags:
114
112
// `devenv container <name> --copy` is now `devenv container copy <name>`
115
113
// `devenv container <name> --docker-run` is now `devenv container run <name>`
You can’t perform that action at this time.
0 commit comments