Skip to content

Commit

Permalink
Merge branch 'main' into 8-run-default-profile
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHedmad committed Jan 3, 2024
2 parents 94428d6 + dcb612b commit 242fd53
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,24 @@ impl Executor {
/// Build the context of this executor and return its tag.
pub fn build_env(&self, signal_receiver: Receiver<bool>) -> Result<String> {
let mut cleanup: Vec<PathBuf> = vec![];
let env_name = "kerblam_runtime";

if self.env.is_none() {
bail!("Cannot build environment with no environment file.")
}

// Move the executor file
cleanup.push(self.target.copy()?);
let dockerfile_path = self.env.clone().unwrap().to_str().unwrap().to_string();
let dockerfile_path = self.env.clone().unwrap();

let dockerfile_name = dockerfile_path
.file_name()
.unwrap()
.to_string_lossy()
.to_string();
let env_name: String = dockerfile_name.split(".").take(1).collect();
let env_name = env_name + "_kerblam_runtime";

let dockerfile_path = dockerfile_path.as_os_str().to_string_lossy().to_string();

let builder = || {
Command::new("docker")
Expand All @@ -160,7 +169,7 @@ impl Executor {
"-f",
dockerfile_path.as_str(),
"--tag",
env_name,
env_name.as_str(),
".",
])
.stdout(Stdio::inherit())
Expand Down

0 comments on commit 242fd53

Please sign in to comment.