did the distrobox stuff
This commit is contained in:
@@ -71,7 +71,8 @@ pub fn project_inline_terminal(project: Project){
|
||||
process::Command::new("distrobox").arg("enter").arg("--root").arg(project.boxname).arg("--").arg("script").arg("-a").arg("-B").arg("/pentest/working/terminal.log").status().expect("error opeing konsole");
|
||||
}
|
||||
|
||||
pub fn make_box(project: &Project, tools_dir: &PathBuf, boxtemplate: &String){
|
||||
pub fn make_box(project: &Project, tools_dir: &PathBuf, boxtemplate: &String, new: bool){
|
||||
if !new{
|
||||
let _distrobox_stop_status = process::Command::new("distrobox").arg("stop").arg("--root").arg(&project.boxname).status().expect("error stopping distrobox");
|
||||
let distrobox_rm_status = process::Command::new("distrobox-rm")
|
||||
.arg("--root")
|
||||
@@ -84,6 +85,7 @@ pub fn make_box(project: &Project, tools_dir: &PathBuf, boxtemplate: &String){
|
||||
else{
|
||||
println!("Distrobox Removal Failed, manual removal required!");
|
||||
}
|
||||
}
|
||||
let mut box_name_path = project.files_folder.clone();
|
||||
let mut box_name = format!("atarchbox_{}", &project.customer);
|
||||
box_name_path.push("boxname");
|
||||
|
||||
@@ -145,7 +145,7 @@ Year: {}
|
||||
"7" => project_controls::remove_project(&mut projects, &config_path),
|
||||
"8" => box_controls::project_standalone_terminal(active_project.clone(), terminal.clone()),
|
||||
"9" => box_controls::project_inline_terminal(active_project.clone()),
|
||||
"10" => box_controls::make_box(&active_project, &tools_dir, &boxtemplate),
|
||||
"10" => box_controls::make_box(&active_project, &tools_dir, &boxtemplate, false),
|
||||
"11" => info_controls::open_in_dolphin("files", active_project.clone()),
|
||||
"12" => info_controls::open_in_dolphin("notes", active_project.clone()),
|
||||
"13" => info_controls::generate_userpass(&active_project),
|
||||
|
||||
@@ -192,7 +192,7 @@ pub fn new_project(projects: &mut Vec<Project>, project_dir: &PathBuf, notes_dir
|
||||
id: new_id,
|
||||
boxname: box_name,
|
||||
};
|
||||
make_box(&new_project, &tools_dir, &boxtemplate);
|
||||
make_box(&new_project, &tools_dir, &boxtemplate, true);
|
||||
projects.push(new_project);
|
||||
save_projects(projects, config_path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user