mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Add dry run mode to xtask release
This commit is contained in:
parent
082dd87b32
commit
9fc2748d47
2 changed files with 9 additions and 6 deletions
|
@ -158,11 +158,13 @@ fn rm_rf(path: &Path) -> Result<()> {
|
||||||
.with_context(|| format!("failed to remove {:?}", path))
|
.with_context(|| format!("failed to remove {:?}", path))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_release() -> Result<()> {
|
pub fn run_release(dry_run: bool) -> Result<()> {
|
||||||
run!("git switch release")?;
|
if !dry_run {
|
||||||
run!("git fetch upstream")?;
|
run!("git switch release")?;
|
||||||
run!("git reset --hard upstream/master")?;
|
run!("git fetch upstream")?;
|
||||||
run!("git push")?;
|
run!("git reset --hard upstream/master")?;
|
||||||
|
run!("git push")?;
|
||||||
|
}
|
||||||
|
|
||||||
let changelog_dir = project_root().join("../rust-analyzer.github.io/thisweek/_posts");
|
let changelog_dir = project_root().join("../rust-analyzer.github.io/thisweek/_posts");
|
||||||
|
|
||||||
|
|
|
@ -93,8 +93,9 @@ FLAGS:
|
||||||
run_pre_cache()
|
run_pre_cache()
|
||||||
}
|
}
|
||||||
"release" => {
|
"release" => {
|
||||||
|
let dry_run = args.contains("--dry-run");
|
||||||
args.finish()?;
|
args.finish()?;
|
||||||
run_release()
|
run_release(dry_run)
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue