tirbofish/dropbear · commit
b4592795143408a482bcefe9519ab7dd5c3ca7ea
got python to be working successfully
Signature present but could not be verified.
Unverified
@@ -1,2 +0,0 @@ -# dropbear - @@ -1,5 +1,6 @@ use std::{ - fs, + fs, io, + path::Path, process::Command, sync::mpsc::{self, Receiver}, }; @@ -55,6 +56,61 @@ impl MainMenu { } } + fn setup_poetry_project(project_path: &Path) -> anyhow::Result<()> { + if !Command::new("poetry").args(["--version"]).output().is_ok() { + return Err(anyhow!( + "Poetry is not installed. Please install it using pipx or the official poetry website" + )); + } + + let status = Command::new("poetry") + .args(&["new", "scripts"]) + .current_dir(project_path) + .status() + .expect("Failed to run poetry new"); + if !status.success() { + return Err(anyhow!(io::Error::new( + io::ErrorKind::Other, + "Poetry project creation failed", + ))); + } + + let scripts_path = project_path.join("scripts"); + if scripts_path.exists() && scripts_path.is_dir() { + for entry in fs::read_dir(&scripts_path)? { + let entry = entry?; + let path = entry.path(); + let file_name = path.file_name().unwrap(); + let dest = project_path.join(file_name); + fs::rename(&path, &dest)?;
Large diffs are not rendered by default. Showing the first 50 of 201 lines. Show full diff