Files
sausage/userland/exec-tools/src/revert.rs
T

26 lines
699 B
Rust

//! Move the world's extension branch to its last successful commit.
fn run() -> std::io::Result<i32> {
let good = std::fs::read_to_string("/src/sausage/.git/sausage-last-good")?;
if good.trim().is_empty() {
return Err(std::io::Error::other("No successful extension commit"));
}
sausage_spawn::Command::new("git")
.args([
"-C",
"/src/sausage",
"update-ref",
"refs/heads/main",
good.trim(),
])
.status()
}
fn main() {
std::process::exit(match run() {
Ok(code) => code,
Err(error) => {
eprintln!("extensions-revert: {error}");
1
}
});
}