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. diff --git a/module/move/gspread/src/commands/gspread_cells.rs b/module/move/gspread/src/commands/gspread_cells.rs index cd7a4cc555..17c230ee38 100644 --- a/module/move/gspread/src/commands/gspread_cells.rs +++ b/module/move/gspread/src/commands/gspread_cells.rs @@ -1,72 +1,72 @@ -//! -//! Cells commands. -//! set command -> set specified values in specified columns in specified row. -//! - -mod private -{ - use clap::Subcommand; - - use crate::*; - use actions::gspread::get_spreadsheet_id_from_url; - - #[ derive( Debug, Subcommand ) ] - pub enum Commands - { - #[ command( name = "set" ) ] - Set - { - #[ arg( long ) ] - select_row_by_key : String, - - #[ arg( long ) ] - json : String, - - #[ arg( long ) ] - url : String, - - #[ arg( long ) ] - tab : String - } - - } - - pub async fn command - ( - hub : &SheetsType, - commands : Commands - ) - { - match commands - { - Commands::Set { select_row_by_key, json, url, tab } => - { - let spreadsheet_id = get_spreadsheet_id_from_url( url.as_str() ).unwrap(); - - let result = actions::gspread_cells_set::action - ( - &hub, - select_row_by_key.as_str(), - json.as_str(), - spreadsheet_id, - tab.as_str() - ).await; - - match result - { - Ok( msg ) => println!( "{}", msg ), - Err( error ) => println!( "{}", error ) - } - } - } - } -} - -crate::mod_interface! -{ - own use - { - command, - Commands - }; +//! +//! Cells commands. +//! set command -> set specified values in specified columns in specified row. +//! + +mod private +{ + use clap::Subcommand; + + use crate::*; + use actions::gspread::get_spreadsheet_id_from_url; + + #[ derive( Debug, Subcommand ) ] + pub enum Commands + { + #[ command( name = "set" ) ] + Set + { + #[ arg( long ) ] + select_row_by_key : String, + + #[ arg( long ) ] + json : String, + + #[ arg( long ) ] + url : String, + + #[ arg( long ) ] + tab : String + } + + } + + pub async fn command + ( + hub : &SheetsType, + commands : Commands + ) + { + match commands + { + Commands::Set { select_row_by_key, json, url, tab } => + { + let spreadsheet_id = get_spreadsheet_id_from_url( url.as_str() ).unwrap(); + + let result = actions::gspread_cells_set::action + ( + &hub, + select_row_by_key.as_str(), + json.as_str(), + spreadsheet_id, + tab.as_str() + ).await; + + match result + { + Ok( msg ) => println!( "{}", msg ), + Err( error ) => println!( "{}", error ) + } + } + } + } +} + +crate::mod_interface! +{ + own use + { + command, + Commands + }; } \ No newline at end of file