I want my script to install lunarvim,
but lunarvim has this unusual way of installing itself.
use duct::cmd;
fn main() {
let command = cmd!("bash", "<(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.4/neovim-0.9/utils/installer/install.sh)", "-y")
.env("LV_BRANCH", "release-1.3/neovim-0.9");
match command.stdout_capture().stderr_capture().unchecked().run() {
Ok(result_command) => {
match result_command.status.success() {
true => {},
false => {
panic!("Process returned an error:\n\n{:?}\n\nOutput stderr:\n\n{}",
command,
String::from_utf8(result_command.stderr).map_err(|non_utf8|
String::from_utf8_lossy(non_utf8.as_bytes()).into_owned())
.unwrap());
},
}
},
Err(e) => panic!("failure: {e}"),
}
}
Result:
thread 'main' panicked at src/main.rs:11:21:
Process returned an error:
Io(Env("LV_BRANCH", "release-1.3/neovim-0.9"), Cmd(["bash", "<(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.4/neovim-0.9/utils/installer/install.sh)", "-y"]))
Output stderr:
bash: <(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.4/neovim-0.9/utils/installer/install.sh): No such file or directory