-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'macos-extend-version-info'
- Loading branch information
Showing
5 changed files
with
89 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
use std::process::Command; | ||
use std::{io, process::Command}; | ||
|
||
/// Helper for getting stdout of some command as a String. Ignores the exit code of the command. | ||
pub fn command_stdout_lossy(cmd: &str, args: &[&str]) -> Option<String> { | ||
pub fn command_stdout_lossy(cmd: &str, args: &[&str]) -> io::Result<String> { | ||
Command::new(cmd) | ||
.args(args) | ||
.output() | ||
.map(|output| String::from_utf8_lossy(&output.stdout).trim().to_string()) | ||
.ok() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters