Add dry run mode to xtask release

This commit is contained in:
Aleksey Kladov 2020-02-14 18:33:30 +01:00
parent 082dd87b32
commit 9fc2748d47
2 changed files with 9 additions and 6 deletions

View file

@ -158,11 +158,13 @@ fn rm_rf(path: &Path) -> Result<()> {
.with_context(|| format!("failed to remove {:?}", path))
}
pub fn run_release() -> Result<()> {
run!("git switch release")?;
run!("git fetch upstream")?;
run!("git reset --hard upstream/master")?;
run!("git push")?;
pub fn run_release(dry_run: bool) -> Result<()> {
if !dry_run {
run!("git switch release")?;
run!("git fetch upstream")?;
run!("git reset --hard upstream/master")?;
run!("git push")?;
}
let changelog_dir = project_root().join("../rust-analyzer.github.io/thisweek/_posts");