summaryrefslogtreecommitdiffstats
path: root/src/commands/build.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-01-08 15:10:49 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-01-14 13:35:34 +0100
commit399cdf75fcdacfb4c68165a1bf401b12ecad1cb9 (patch)
tree75a5bbd9ae83c29014ce77905b2785726aef4c5b /src/commands/build.rs
parentb6a52fd28003ed3ce251a3647e837ca11b9d1222 (diff)
Move splitting of CLI env k-v-string to utility module
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/commands/build.rs')
-rw-r--r--src/commands/build.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/commands/build.rs b/src/commands/build.rs
index 419f661..75831a6 100644
--- a/src/commands/build.rs
+++ b/src/commands/build.rs
@@ -117,13 +117,7 @@ pub async fn build(repo_root: &Path,
let additional_env = matches.values_of("env")
.unwrap_or_default()
- .map(|s| {
- let v = s.split("=").collect::<Vec<_>>();
- Ok((
- EnvironmentVariableName::from(*v.get(0).ok_or_else(|| anyhow!("Environment variable has no key: {}", s))?),
- String::from(*v.get(1).ok_or_else(|| anyhow!("Environment variable has no key: {}", s))?)
- ))
- })
+ .map(crate::util::env::parse_to_env)
.collect::<Result<Vec<(EnvironmentVariableName, String)>>>()?;
let packages = if let Some(pvers) = pvers {