aboutsummaryrefslogtreecommitdiff
path: root/dev_tools/src/bin/ci.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-05-21 15:21:42 +0800
committer魏曹先生 <1992414357@qq.com>2026-05-21 15:21:42 +0800
commit099344ca38b54ecfc481fc705eaf7db001377915 (patch)
tree37e3781a98246b4d034ff6a3d95bf0e1312ab046 /dev_tools/src/bin/ci.rs
parent74b5a80475e2230c0a494beac5ec86a985c2974f (diff)
Restore changes on CI failure after temp commit
Diffstat (limited to 'dev_tools/src/bin/ci.rs')
-rw-r--r--dev_tools/src/bin/ci.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/dev_tools/src/bin/ci.rs b/dev_tools/src/bin/ci.rs
index a5f581d..554425e 100644
--- a/dev_tools/src/bin/ci.rs
+++ b/dev_tools/src/bin/ci.rs
@@ -14,10 +14,16 @@ fn main() {
run_cmd!("git commit -m \"CI Temp\"").unwrap();
}
- if ci().is_ok() {
- println_cargo_style!("Done: All check passed!")
+ if let Err(exit_code) = ci() {
+ if needs_commit_temp {
+ run_cmd!("git restore .").unwrap();
+ run_cmd!("git reset --soft HEAD~1").unwrap();
+ }
+ exit(exit_code)
}
+ println_cargo_style!("Done: All check passed!");
+
let is_worktree_clean = run_cmd!("git diff-index --quiet HEAD --").is_ok();
if !is_worktree_clean {
eprintln_cargo_style!("Documents needs refresh!");