mirror of
https://github.com/soywod/himalaya.git
synced 2024-09-29 12:31:13 +00:00
ad7cd28a3c
* init cargo workspaces * nix: fix assets path * doc: update rtp vim plugin * vim: add error message if loading vim plugin from vim/
14 lines
369 B
Rust
14 lines
369 B
Rust
use anyhow::Result;
|
|
use std::process::Command;
|
|
|
|
/// TODO: move this in a more approriate place.
|
|
pub fn run_cmd(cmd: &str) -> Result<String> {
|
|
let output = if cfg!(target_os = "windows") {
|
|
Command::new("cmd").args(&["/C", cmd]).output()
|
|
} else {
|
|
Command::new("sh").arg("-c").arg(cmd).output()
|
|
}?;
|
|
|
|
Ok(String::from_utf8(output.stdout)?)
|
|
}
|