Load world extensions from commit snapshots with last-good recovery
This commit is contained in:
@@ -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
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user