Skip to content

Commit cc86ba4

Browse files
committed
devenv: fix building containers
1 parent fe54ce9 commit cc86ba4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

devenv/src/devenv.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,10 @@ impl Devenv {
463463
skip(self),
464464
fields(devenv.user_message = format!("Building {name} container"))
465465
)]
466-
pub async fn container_build(&self, name: &str) -> Result<String> {
466+
pub async fn container_build(&mut self, name: &str) -> Result<String> {
467+
// This container name is passed to the flake as an argument and tells the module system
468+
// that we're 1. building a container 2. which container we're building.
469+
self.container_name = Some(name.to_string());
467470
self.assemble(false).await?;
468471

469472
let sanitized_name = sanitize_container_name(name);
@@ -483,7 +486,7 @@ impl Devenv {
483486
}
484487

485488
pub async fn container_copy(
486-
&self,
489+
&mut self,
487490
name: &str,
488491
copy_args: &[String],
489492
registry: Option<&str>,
@@ -534,7 +537,7 @@ impl Devenv {
534537
}
535538

536539
pub async fn container_run(
537-
&self,
540+
&mut self,
538541
name: &str,
539542
copy_args: &[String],
540543
registry: Option<&str>,

devenv/src/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ async fn main() -> Result<()> {
108108
name,
109109
command,
110110
} => {
111-
devenv.container_name = name.clone();
112-
113111
// Backwards compatibility for the legacy container flags:
114112
// `devenv container <name> --copy` is now `devenv container copy <name>`
115113
// `devenv container <name> --docker-run` is now `devenv container run <name>`

0 commit comments

Comments
 (0)