From 348ce7a95ea5ab6b30a8526dbf89c4dd4f2c3b2d Mon Sep 17 00:00:00 2001 From: Vsevolod Date: Wed, 4 Dec 2024 15:36:52 +0100 Subject: [PATCH 1/2] fix file --- module/core/process_tools/src/process.rs | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/module/core/process_tools/src/process.rs b/module/core/process_tools/src/process.rs index d11e5c3d16..bcb7ad6936 100644 --- a/module/core/process_tools/src/process.rs +++ b/module/core/process_tools/src/process.rs @@ -234,22 +234,22 @@ mod private // # Returns: // A `Result` containing a `Report` on success, which includes the command's output, // or an error if the command fails to execute or complete. - // pub fn run_with_shell( self, exec_path : &str, ) -> Result< Report, Report > - // { - // let ( program, args ) = - // if cfg!( target_os = "windows" ) - // { - // ( "gspread", [ "/C", exec_path ] ) - // } - // else - // { - // ( "sh", [ "-c", exec_path ] ) - // }; - // self - // .args( args.into_iter().map( OsString::from ).collect::< Vec< _ > >() ) - // .bin_path( program ) - // .run() - // } + pub fn run_with_shell( self, exec_path : &str, ) -> Result< Report, Report > + { + let ( program, args ) = + if cfg!( target_os = "windows" ) + { + ( "cmd", [ "/C", exec_path ] ) + } + else + { + ( "sh", [ "-c", exec_path ] ) + }; + self + .args( args.into_iter().map( OsString::from ).collect::< Vec< _ > >() ) + .bin_path( program ) + .run() + } } /// Process command output. From 19cedef814ac498d2a66148184f4826d33c902d8 Mon Sep 17 00:00:00 2001 From: Vsevolod Date: Wed, 4 Dec 2024 15:44:02 +0100 Subject: [PATCH 2/2] fix process file --- module/core/process_tools/src/process.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/module/core/process_tools/src/process.rs b/module/core/process_tools/src/process.rs index bcb7ad6936..d58e95455a 100644 --- a/module/core/process_tools/src/process.rs +++ b/module/core/process_tools/src/process.rs @@ -54,7 +54,7 @@ mod private // let ( program, args ) = // if cfg!( target_os = "windows" ) // { - // ( "gspread", [ "/C", exec_path ] ) + // ( "cmd", [ "/C", exec_path ] ) // } // else // { @@ -223,17 +223,17 @@ mod private run( self.form() ) } - // Executes an external process using the system shell. - // - // This function abstracts over the differences between shells on Windows and Unix-based - // systems, allowing for a unified interface to execute shell commands. - // - // # Parameters: - // - `exec_path`: The command line string to execute in the shell. - // - // # Returns: - // A `Result` containing a `Report` on success, which includes the command's output, - // or an error if the command fails to execute or complete. + /// Executes an external process using the system shell. + /// + /// This function abstracts over the differences between shells on Windows and Unix-based + /// systems, allowing for a unified interface to execute shell commands. + /// + /// # Parameters: + /// - `exec_path`: The command line string to execute in the shell. + /// + /// # Returns: + /// A `Result` containing a `Report` on success, which includes the command's output, + /// or an error if the command fails to execute or complete. pub fn run_with_shell( self, exec_path : &str, ) -> Result< Report, Report > { let ( program, args ) =