mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Cleanup install command
This commit is contained in:
parent
97b1550dda
commit
142f9a03fd
4 changed files with 56 additions and 51 deletions
|
@ -28,11 +28,7 @@ use std::{
|
|||
use walkdir::{DirEntry, WalkDir};
|
||||
use xshell::{cmd, cp, pushd, pushenv};
|
||||
|
||||
use crate::{
|
||||
codegen::Mode,
|
||||
dist::DistCmd,
|
||||
install::{InstallCmd, Malloc, ServerOpt},
|
||||
};
|
||||
use crate::{codegen::Mode, dist::DistCmd};
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let _d = pushd(project_root())?;
|
||||
|
@ -43,30 +39,9 @@ fn main() -> Result<()> {
|
|||
println!("{}", flags::Xtask::HELP);
|
||||
return Ok(());
|
||||
}
|
||||
flags::XtaskCmd::Install(flags) => {
|
||||
if flags.server && flags.client {
|
||||
eprintln!(
|
||||
"error: The argument `--server` cannot be used with `--client`\n\n\
|
||||
For more information try --help"
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let malloc = if flags.mimalloc {
|
||||
Malloc::Mimalloc
|
||||
} else if flags.jemalloc {
|
||||
Malloc::Jemalloc
|
||||
} else {
|
||||
Malloc::System
|
||||
};
|
||||
|
||||
let client_bin = flags.code_bin.map(|it| it.parse()).transpose()?;
|
||||
|
||||
InstallCmd {
|
||||
client: if flags.server { None } else { Some(client_bin).unwrap_or_default() },
|
||||
server: if flags.client { None } else { Some(ServerOpt { malloc }) },
|
||||
}
|
||||
.run()
|
||||
flags::XtaskCmd::Install(cmd) => {
|
||||
cmd.validate()?;
|
||||
cmd.run()
|
||||
}
|
||||
flags::XtaskCmd::Codegen(cmd) => cmd.run(),
|
||||
flags::XtaskCmd::Lint(_) => run_clippy(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue