aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/dist.rs
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src/dist.rs')
-rw-r--r--xtask/src/dist.rs27
1 files changed, 17 insertions, 10 deletions
diff --git a/xtask/src/dist.rs b/xtask/src/dist.rs
index c198c0907..01d903cde 100644
--- a/xtask/src/dist.rs
+++ b/xtask/src/dist.rs
@@ -13,17 +13,24 @@ use crate::{
13 project_root, 13 project_root,
14}; 14};
15 15
16pub fn run_dist(nightly: bool, client_version: Option<String>) -> Result<()> { 16pub struct DistCmd {
17 let dist = project_root().join("dist"); 17 pub nightly: bool,
18 rm_rf(&dist)?; 18 pub client_version: Option<String>,
19 fs2::create_dir_all(&dist)?; 19}
20 20
21 if let Some(version) = client_version { 21impl DistCmd {
22 let release_tag = if nightly { "nightly".to_string() } else { date_iso()? }; 22 pub fn run(self) -> Result<()> {
23 dist_client(&version, &release_tag)?; 23 let dist = project_root().join("dist");
24 rm_rf(&dist)?;
25 fs2::create_dir_all(&dist)?;
26
27 if let Some(version) = self.client_version {
28 let release_tag = if self.nightly { "nightly".to_string() } else { date_iso()? };
29 dist_client(&version, &release_tag)?;
30 }
31 dist_server()?;
32 Ok(())
24 } 33 }
25 dist_server()?;
26 Ok(())
27} 34}
28 35
29fn dist_client(version: &str, release_tag: &str) -> Result<()> { 36fn dist_client(version: &str, release_tag: &str) -> Result<()> {