fixed a bug where distrobox creation was failing because of folder

naming logic for the volumes
This commit is contained in:
pyro committed 2026-10-01 10:51:28 -05:00
1 parent 29bc50468d
commit f4188459fe
1 file changed
+8 -2
+8 -2
View File
@@ -324,11 +324,17 @@ impl DistroBox {
.arg(self.name.clone());
let mut added_volumes = Vec::new();
for volume in &self.volumes {
let folder_name = volume.split("/").last().unwrap();
let mut folder_name = volume.split("/").last().unwrap();
if folder_name.contains("pentest")
|| folder_name.contains("project")
|| folder_name.contains("ctf")
{
folder_name = "project";
}
if !added_volumes.contains(&String::from(folder_name)) {
create_command
.arg("--volume")
.arg(format!("{}:/project:rw", volume));
.arg(format!("{}:/{}:rw", volume, folder_name));
added_volumes.push(folder_name.to_string());
}
}