oseda_cli/cmd/update.rs
1use std::{
2 error::Error,
3 process::{Command, Stdio},
4};
5
6pub fn update() -> Result<(), Box<dyn Error>> {
7 let status = Command::new("cargo")
8 .args(["install", "oseda-cli"])
9 .stdout(Stdio::inherit())
10 .stdin(Stdio::inherit())
11 .status()?;
12
13 if !status.success() {
14 return Err(format!("Error: exit status {}", status).into());
15 }
16
17 Ok(())
18}