Skip to content

Commit

Permalink
Ensure directory exists before writing tar dir
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Jun 11, 2024
1 parent 6d3024b commit 8909075
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions jruby_executable/src/bin/jruby_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,14 @@ fn jruby_build(args: &Args) -> Result<(), Error> {

log = {
let mut bullet = log.bullet("Creating tgz archives");
let tar_dir = volume_output_dir
.join(base_image.to_string())
.join(&tgz_name);

let timer = bullet.start_timer(format!("Write {}", tar_dir.display()));
tar_dir_to_file(
&jruby_dir,
fs_err::File::create(&tar_dir).map_err(Error::IoError)?,
)?;
let tar_dir = volume_output_dir.join(base_image.to_string());

fs_err::create_dir_all(&tar_dir).map_err(Error::IoError)?;

let tar_file = fs_err::File::create(tar_dir.join(&tgz_name)).map_err(Error::IoError)?;

let timer = bullet.start_timer(format!("Write {}", tar_file.path().display()));
tar_dir_to_file(&jruby_dir, tar_file)?;
bullet = timer.done();

for arch in &["amd64", "arm64"] {
Expand Down

0 comments on commit 8909075

Please sign in to comment.