Load world extensions from commit snapshots with last-good recovery

This commit is contained in:
2026-11-07 10:38:20 +00:00
parent 534fa50615
commit bcb3e4d8e5
17 changed files with 42251 additions and 399 deletions
+25
View File
@@ -0,0 +1,25 @@
//! 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
}
});
}