aboutsummaryrefslogtreecommitdiff
path: root/release/src/cargo.rs
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2025-08-16 11:14:15 +0200
committerUlf Lilleengen <[email protected]>2025-08-25 19:44:50 +0200
commit1f229f745c0ccee926ae5c4cf6732d41c4beb531 (patch)
treec6d757d2cf2e46b317c1b2a398d8043103409932 /release/src/cargo.rs
parent0d8f9614a1af5a45b695e6f63b0337fc3bccba76 (diff)
fix: use patched versions
Diffstat (limited to 'release/src/cargo.rs')
-rw-r--r--release/src/cargo.rs37
1 files changed, 2 insertions, 35 deletions
diff --git a/release/src/cargo.rs b/release/src/cargo.rs
index 826a3a8b2..498dfeb97 100644
--- a/release/src/cargo.rs
+++ b/release/src/cargo.rs
@@ -4,18 +4,10 @@ use std::ffi::OsStr;
4use std::path::{Path, PathBuf}; 4use std::path::{Path, PathBuf};
5use std::process::{Command, Stdio}; 5use std::process::{Command, Stdio};
6 6
7use anyhow::{bail, Context as _, Result}; 7use anyhow::{bail, Result};
8use clap::ValueEnum as _;
9use serde::{Deserialize, Serialize}; 8use serde::{Deserialize, Serialize};
10use toml_edit::{DocumentMut, Formatted, Item, Value};
11 9
12use crate::{windows_safe_path, Crate}; 10use crate::windows_safe_path;
13
14#[derive(Clone, Debug, PartialEq)]
15pub enum CargoAction {
16 Build(PathBuf),
17 Run,
18}
19 11
20#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] 12#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
21pub struct Artifact { 13pub struct Artifact {
@@ -23,12 +15,6 @@ pub struct Artifact {
23} 15}
24 16
25/// Execute cargo with the given arguments and from the specified directory. 17/// Execute cargo with the given arguments and from the specified directory.
26pub fn run(args: &[String], cwd: &Path) -> Result<()> {
27 run_with_env::<[(&str, &str); 0], _, _>(args, cwd, [], false)?;
28 Ok(())
29}
30
31/// Execute cargo with the given arguments and from the specified directory.
32pub fn run_with_env<I, K, V>(args: &[String], cwd: &Path, envs: I, capture: bool) -> Result<String> 18pub fn run_with_env<I, K, V>(args: &[String], cwd: &Path, envs: I, capture: bool) -> Result<String>
33where 19where
34 I: IntoIterator<Item = (K, V)> + core::fmt::Debug, 20 I: IntoIterator<Item = (K, V)> + core::fmt::Debug,
@@ -167,25 +153,6 @@ impl CargoArgsBuilder {
167 } 153 }
168 154
169 #[must_use] 155 #[must_use]
170 pub fn args<S>(mut self, args: &[S]) -> Self
171 where
172 S: Clone + Into<String>,
173 {
174 for arg in args {
175 self.args.push(arg.clone().into());
176 }
177 self
178 }
179
180 pub fn add_arg<S>(&mut self, arg: S) -> &mut Self
181 where
182 S: Into<String>,
183 {
184 self.args.push(arg.into());
185 self
186 }
187
188 #[must_use]
189 pub fn build(&self) -> Vec<String> { 156 pub fn build(&self) -> Vec<String> {
190 let mut args = vec![]; 157 let mut args = vec![];
191 158