diff options
| author | Ulf Lilleengen <[email protected]> | 2025-08-16 11:14:15 +0200 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2025-08-25 19:44:50 +0200 |
| commit | 1f229f745c0ccee926ae5c4cf6732d41c4beb531 (patch) | |
| tree | c6d757d2cf2e46b317c1b2a398d8043103409932 /release/src/cargo.rs | |
| parent | 0d8f9614a1af5a45b695e6f63b0337fc3bccba76 (diff) | |
fix: use patched versions
Diffstat (limited to 'release/src/cargo.rs')
| -rw-r--r-- | release/src/cargo.rs | 37 |
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; | |||
| 4 | use std::path::{Path, PathBuf}; | 4 | use std::path::{Path, PathBuf}; |
| 5 | use std::process::{Command, Stdio}; | 5 | use std::process::{Command, Stdio}; |
| 6 | 6 | ||
| 7 | use anyhow::{bail, Context as _, Result}; | 7 | use anyhow::{bail, Result}; |
| 8 | use clap::ValueEnum as _; | ||
| 9 | use serde::{Deserialize, Serialize}; | 8 | use serde::{Deserialize, Serialize}; |
| 10 | use toml_edit::{DocumentMut, Formatted, Item, Value}; | ||
| 11 | 9 | ||
| 12 | use crate::{windows_safe_path, Crate}; | 10 | use crate::windows_safe_path; |
| 13 | |||
| 14 | #[derive(Clone, Debug, PartialEq)] | ||
| 15 | pub enum CargoAction { | ||
| 16 | Build(PathBuf), | ||
| 17 | Run, | ||
| 18 | } | ||
| 19 | 11 | ||
| 20 | #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] | 12 | #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] |
| 21 | pub struct Artifact { | 13 | pub 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. |
| 26 | pub 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. | ||
| 32 | pub fn run_with_env<I, K, V>(args: &[String], cwd: &Path, envs: I, capture: bool) -> Result<String> | 18 | pub fn run_with_env<I, K, V>(args: &[String], cwd: &Path, envs: I, capture: bool) -> Result<String> |
| 33 | where | 19 | where |
| 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 | ||
