aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-23 13:33:44 +0000
committerAleksey Kladov <[email protected]>2020-03-23 13:33:44 +0000
commit59f6bf87d651d987be63941d42999ac205f891b2 (patch)
tree22d845c4bd45bf9dab8a11c735cbb27042006653 /xtask
parentf8fd242199bb5cb41ab2579548b89dbfe6af94c2 (diff)
Fix release
Diffstat (limited to 'xtask')
-rw-r--r--xtask/src/dist.rs11
-rw-r--r--xtask/src/main.rs14
2 files changed, 18 insertions, 7 deletions
diff --git a/xtask/src/dist.rs b/xtask/src/dist.rs
index 2002d3e2a..78dea08e7 100644
--- a/xtask/src/dist.rs
+++ b/xtask/src/dist.rs
@@ -7,13 +7,18 @@ use crate::{
7 project_root, 7 project_root,
8}; 8};
9 9
10pub fn run_dist(version: &str, release_tag: &str) -> Result<()> { 10pub struct ClientOpts {
11 pub version: String,
12 pub release_tag: String,
13}
14
15pub fn run_dist(client_opts: Option<ClientOpts>) -> Result<()> {
11 let dist = project_root().join("dist"); 16 let dist = project_root().join("dist");
12 rm_rf(&dist)?; 17 rm_rf(&dist)?;
13 fs2::create_dir_all(&dist)?; 18 fs2::create_dir_all(&dist)?;
14 19
15 if cfg!(target_os = "linux") { 20 if let Some(ClientOpts { version, release_tag}) = client_opts {
16 dist_client(version, release_tag)?; 21 dist_client(&version, &release_tag)?;
17 } 22 }
18 dist_server()?; 23 dist_server()?;
19 Ok(()) 24 Ok(())
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index aafa73610..b1a56b67f 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -13,7 +13,7 @@ use std::env;
13use pico_args::Arguments; 13use pico_args::Arguments;
14use xtask::{ 14use xtask::{
15 codegen::{self, Mode}, 15 codegen::{self, Mode},
16 dist::run_dist, 16 dist::{ClientOpts, run_dist},
17 install::{ClientOpt, InstallCmd, ServerOpt}, 17 install::{ClientOpt, InstallCmd, ServerOpt},
18 not_bash::pushd, 18 not_bash::pushd,
19 pre_commit, project_root, run_clippy, run_fuzzer, run_pre_cache, run_release, run_rustfmt, 19 pre_commit, project_root, run_clippy, run_fuzzer, run_pre_cache, run_release, run_rustfmt,
@@ -103,10 +103,16 @@ FLAGS:
103 run_release(dry_run) 103 run_release(dry_run)
104 } 104 }
105 "dist" => { 105 "dist" => {
106 let version: String = args.value_from_str("--version")?; 106 let client_opts = if args.contains("--client") {
107 let release_tag: String = args.value_from_str("--tag")?; 107 Some(ClientOpts {
108 version: args.value_from_str("--version")?,
109 release_tag: args.value_from_str("--tag")?,
110 })
111 } else {
112 None
113 };
108 args.finish()?; 114 args.finish()?;
109 run_dist(&version, &release_tag) 115 run_dist(client_opts)
110 } 116 }
111 _ => { 117 _ => {
112 eprintln!( 118 eprintln!(