Skip to main content

execute_command_sync_optional

Function execute_command_sync_optional 

Source
pub fn execute_command_sync_optional(
    cmd: impl AsRef<OsStr>,
    args: &[impl AsRef<OsStr>],
) -> Option<String>
Expand description

Execute a command synchronously and return output, ignoring errors

§Arguments

  • cmd - Command to execute
  • args - Command arguments

§Returns

  • Option<String> - Command output or None if failed