mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Merge #5523
5523: Minor r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
3d799b66df
2 changed files with 20 additions and 12 deletions
|
@ -13,17 +13,24 @@ use crate::{
|
||||||
project_root,
|
project_root,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn run_dist(nightly: bool, client_version: Option<String>) -> Result<()> {
|
pub struct DistCmd {
|
||||||
|
pub nightly: bool,
|
||||||
|
pub client_version: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl DistCmd {
|
||||||
|
pub fn run(self) -> Result<()> {
|
||||||
let dist = project_root().join("dist");
|
let dist = project_root().join("dist");
|
||||||
rm_rf(&dist)?;
|
rm_rf(&dist)?;
|
||||||
fs2::create_dir_all(&dist)?;
|
fs2::create_dir_all(&dist)?;
|
||||||
|
|
||||||
if let Some(version) = client_version {
|
if let Some(version) = self.client_version {
|
||||||
let release_tag = if nightly { "nightly".to_string() } else { date_iso()? };
|
let release_tag = if self.nightly { "nightly".to_string() } else { date_iso()? };
|
||||||
dist_client(&version, &release_tag)?;
|
dist_client(&version, &release_tag)?;
|
||||||
}
|
}
|
||||||
dist_server()?;
|
dist_server()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dist_client(version: &str, release_tag: &str) -> Result<()> {
|
fn dist_client(version: &str, release_tag: &str) -> Result<()> {
|
||||||
|
|
|
@ -13,7 +13,7 @@ use std::env;
|
||||||
use pico_args::Arguments;
|
use pico_args::Arguments;
|
||||||
use xtask::{
|
use xtask::{
|
||||||
codegen::{self, Mode},
|
codegen::{self, Mode},
|
||||||
dist::run_dist,
|
dist::DistCmd,
|
||||||
install::{ClientOpt, InstallCmd, Malloc, ServerOpt},
|
install::{ClientOpt, InstallCmd, Malloc, ServerOpt},
|
||||||
not_bash::pushd,
|
not_bash::pushd,
|
||||||
pre_commit, project_root,
|
pre_commit, project_root,
|
||||||
|
@ -115,7 +115,7 @@ FLAGS:
|
||||||
let nightly = args.contains("--nightly");
|
let nightly = args.contains("--nightly");
|
||||||
let client_version: Option<String> = args.opt_value_from_str("--client")?;
|
let client_version: Option<String> = args.opt_value_from_str("--client")?;
|
||||||
args.finish()?;
|
args.finish()?;
|
||||||
run_dist(nightly, client_version)
|
DistCmd { nightly, client_version }.run()
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
|
@ -133,7 +133,8 @@ SUBCOMMANDS:
|
||||||
codegen
|
codegen
|
||||||
install
|
install
|
||||||
lint
|
lint
|
||||||
dist"
|
dist
|
||||||
|
promote"
|
||||||
);
|
);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue