fixed a bug where distrobox creation was failing because of folder
naming logic for the volumes
This commit is contained in:
1 parent
29bc50468d
commit
f4188459fe
1 file changed
+8
-2
+8
-2
@@ -324,11 +324,17 @@ impl DistroBox {
|
|||||||
.arg(self.name.clone());
|
.arg(self.name.clone());
|
||||||
let mut added_volumes = Vec::new();
|
let mut added_volumes = Vec::new();
|
||||||
for volume in &self.volumes {
|
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)) {
|
if !added_volumes.contains(&String::from(folder_name)) {
|
||||||
create_command
|
create_command
|
||||||
.arg("--volume")
|
.arg("--volume")
|
||||||
.arg(format!("{}:/project:rw", volume));
|
.arg(format!("{}:/{}:rw", volume, folder_name));
|
||||||
added_volumes.push(folder_name.to_string());
|
added_volumes.push(folder_name.to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user