chore: Remove need to update .gitignore by making use of temporary directories

This commit is contained in:
Gerald Pinder 2024-11-06 23:58:28 -05:00
parent 5ff001816c
commit 752c957914
11 changed files with 61 additions and 202 deletions

View file

@ -18,7 +18,7 @@ use miette::{bail, IntoDiagnostic, Result};
use once_cell::sync::Lazy;
use semver::Version;
use serde::Deserialize;
use tempdir::TempDir;
use tempfile::TempDir;
use crate::{
drivers::{
@ -388,7 +388,7 @@ impl InspectDriver for DockerDriver {
impl RunDriver for DockerDriver {
fn run(opts: &RunOpts) -> std::io::Result<ExitStatus> {
let cid_path = TempDir::new("docker")?;
let cid_path = TempDir::new()?;
let cid_file = cid_path.path().join("cid");
let cid = ContainerId::new(&cid_file, ContainerRuntime::Docker, false);
@ -403,7 +403,7 @@ impl RunDriver for DockerDriver {
}
fn run_output(opts: &RunOpts) -> std::io::Result<std::process::Output> {
let cid_path = TempDir::new("docker")?;
let cid_path = TempDir::new()?;
let cid_file = cid_path.path().join("cid");
let cid = ContainerId::new(&cid_file, ContainerRuntime::Docker, false);