diff --git a/src/virt/buildah/example.rs b/examples/buildah.rs similarity index 96% rename from src/virt/buildah/example.rs rename to examples/buildah.rs index e00b414..f26fb39 100644 --- a/src/virt/buildah/example.rs +++ b/examples/buildah.rs @@ -4,7 +4,7 @@ //! common container operations like creating containers, running commands, //! and managing images. -use crate::virt::buildah::{self, BuildahError}; +use sal::virt::buildah::{self, BuildahError}; use std::collections::HashMap; /// Run a complete buildah workflow example @@ -114,12 +114,16 @@ pub fn run_all_examples() -> Result<(), BuildahError> { // Uncomment these to run the examples run_buildah_example()?; - build_image_example()?; - registry_operations_example()?; + // build_image_example()?; + // registry_operations_example()?; println!("\nTo run these examples, uncomment the function calls in run_all_examples()"); println!("Note that these examples require buildah to be installed on your system"); println!("and may require root/sudo privileges depending on your setup."); Ok(()) +} + +fn main() { + run_all_examples(); } \ No newline at end of file diff --git a/src/git/git.rs b/src/git/git.rs index c001a3b..7f0afca 100644 --- a/src/git/git.rs +++ b/src/git/git.rs @@ -80,7 +80,7 @@ impl Error for GitError { */ pub fn git_clone(url: &str) -> Result { // Check if git is installed - let git_check = Command::new("git") + let _git_check = Command::new("git") .arg("--version") .output() .map_err(GitError::GitNotInstalled)?; diff --git a/src/git/git_executor.rs b/src/git/git_executor.rs index 27f4ee5..197426b 100644 --- a/src/git/git_executor.rs +++ b/src/git/git_executor.rs @@ -293,17 +293,6 @@ impl GitExecutor { // Execute git command with username/password fn execute_with_credentials(&self, args: &[&str], username: &str, password: &str) -> Result { - // Helper method to execute a command and handle the result - fn execute_command(command: &mut Command) -> Result { - let output = command.output()?; - - if output.status.success() { - Ok(output) - } else { - let error = String::from_utf8_lossy(&output.stderr); - Err(GitExecutorError::GitCommandFailed(error.to_string())) - } - } // For HTTPS authentication, we need to modify the URL to include credentials // Create a new vector to hold our modified arguments let modified_args: Vec = args.iter().map(|&arg| { diff --git a/src/process/run.rs b/src/process/run.rs index f7e3cc8..49018ab 100644 --- a/src/process/run.rs +++ b/src/process/run.rs @@ -76,7 +76,7 @@ pub struct CommandResult { impl CommandResult { /// Create a default failed result with an error message - fn error(message: &str) -> Self { + fn _error(message: &str) -> Self { Self { stdout: String::new(), stderr: message.to_string(), @@ -132,10 +132,6 @@ fn handle_child_output(mut child: Child, silent: bool) -> Result Result