From dbfba06e2ca268433616dc655eba8c301c46a739 Mon Sep 17 00:00:00 2001 From: jonathanpv Date: Sat, 11 Mar 2023 22:41:37 -0500 Subject: [PATCH 1/6] chore(vdev): Rewrite release-homebrew into vdev --- Cargo.lock | 5 ++ scripts/release-homebrew.sh | 36 ------------ vdev/Cargo.toml | 5 ++ vdev/src/commands/release/homebrew.rs | 80 +++++++++++++++++++++++++++ vdev/src/commands/release/mod.rs | 6 +- vdev/src/git.rs | 60 +++++++++++++++++++- 6 files changed, 149 insertions(+), 43 deletions(-) delete mode 100755 scripts/release-homebrew.sh create mode 100644 vdev/src/commands/release/homebrew.rs diff --git a/Cargo.lock b/Cargo.lock index dbbad51299606..95e5ebdea3cd8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9316,6 +9316,7 @@ dependencies = [ "directories", "dunce", "hashlink", + "hex", "indicatif", "itertools", "log", @@ -9323,9 +9324,13 @@ dependencies = [ "os_info", "owo-colors", "paste", + "regex", + "reqwest", "serde", "serde_json", "serde_yaml 0.9.19", + "sha2 0.10.6", + "tempfile", "toml 0.7.2", ] diff --git a/scripts/release-homebrew.sh b/scripts/release-homebrew.sh deleted file mode 100755 index 18e4af7798f41..0000000000000 --- a/scripts/release-homebrew.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# release-homebrew.sh -# -# SUMMARY -# -# Releases latest version to the vectordotdev homebrew tap - -td="$(mktemp -d)" -pushd "$td" - -git config --global user.email "vector@datadoghq.com" -git config --global user.name "vic" - -git clone "https://$GITHUB_TOKEN:x-oauth-basic@github.com/vectordotdev/homebrew-brew" -cd homebrew-brew - -PACKAGE_URL="https://packages.timber.io/vector/$VECTOR_VERSION/vector-$VECTOR_VERSION-x86_64-apple-darwin.tar.gz" -PACKAGE_SHA256=$(curl -fsSL "$PACKAGE_URL" | sha256sum | cut -d " " -f 1) - -update-content() { - sed "s|url \".*\"|url \"$PACKAGE_URL\"|" \ - | sed "s|sha256 \".*\"|sha256 \"$PACKAGE_SHA256\"|" \ - | sed "s|version \".*\"|version \"$VECTOR_VERSION\"|" -} - -NEW_CONTENT="$(update-content < Formula/vector.rb)" - -echo "$NEW_CONTENT" > Formula/vector.rb - -git diff-index --quiet HEAD || git commit -am "Release Vector $VECTOR_VERSION" -git push - -popd -rm -rf "$td" diff --git a/vdev/Cargo.toml b/vdev/Cargo.toml index 860830928f205..b41f41776770b 100644 --- a/vdev/Cargo.toml +++ b/vdev/Cargo.toml @@ -19,6 +19,7 @@ directories = "4.0.1" # remove this when stabilized https://doc.rust-lang.org/stable/std/path/fn.absolute.html dunce = "1.0.3" hashlink = { version = "0.8.1", features = ["serde_impl"] } +hex = "0.4.3" indicatif = { version = "0.17.3", features = ["improved_unicode"] } itertools = "0.10.5" log = "0.4.17" @@ -27,7 +28,11 @@ os_info = { version = "3.6.0", default-features = false } # watch https://github.com/epage/anstyle for official interop with Clap owo-colors = { version = "3.5.0", features = ["supports-colors"] } paste = "1.0.12" +regex = { version = "1.7.1", default-features = false, features = ["std", "perf"] } +reqwest = { version = "0.11", features = ["json", "blocking"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.94" serde_yaml = "0.9.19" +sha2 = "0.10.6" +tempfile = "3.4.0" toml = { version = "0.7.2", default-features = false, features = ["parse"] } diff --git a/vdev/src/commands/release/homebrew.rs b/vdev/src/commands/release/homebrew.rs new file mode 100644 index 0000000000000..0d88e61092573 --- /dev/null +++ b/vdev/src/commands/release/homebrew.rs @@ -0,0 +1,80 @@ +use anyhow::{Result}; +use std::env; +use tempfile::TempDir; +use crate::git; +use hex; +use sha2::Digest; +use reqwest::blocking::get; +use std::path::Path; +use regex; + +/// Releases latest version to the vectordotdev homebrew tap +#[derive(clap::Args, Debug)] +#[command()] +pub struct Cli {} + +impl Cli { + pub fn exec(self) -> Result<()> { + // Create temporary directory for cloning the homebrew-brew repository + let td = TempDir::new()?; + env::set_current_dir(td.path())?; + + // Set git configurations + let config_values = vec![ + ("user.name", "vic"), + ("user.email", "vector@datadoghq.com"), + ]; + git::set_config_values(config_values)?; + let github_token = env::var("GITHUB_TOKEN")?; + + // Clone the homebrew-brew repository + let homebrew_dir = td.path().join("homebrew-brew"); + let homebrew_repo = format!("https://{github_token}:x-oauth-basic@github.com/vectordotdev/homebrew-brew"); + git::clone(&homebrew_repo)?; + env::set_current_dir(&homebrew_dir)?; + + // Get package details for updating Formula/vector.rb + // TODO: use app::version() when it's checked in to master, currently in another PR here: https://github.com/vectordotdev/vector/pull/16724/files#diff-492220caf4fa036bb031d00a23eaa01aa4a0fd5636b2a789bd18f3ce184ede21 + let vector_version = env::var("VECTOR_VERSION")?; + let package_url = format!("https://packages.timber.io/vector/{vector_version}/vector-{vector_version}-x86_64-apple-darwin.tar.gz"); + let package_sha256 = hex::encode(sha2::Sha256::digest(get(&package_url)?.bytes()?)); + + // Update content of Formula/vector.rb + let file_path = homebrew_dir.join("Formula").join("vector.rb"); + let new_content = update_content(file_path.as_path(), &package_url, &package_sha256, &vector_version)?; + std::fs::write(file_path, new_content)?; + + // Check if there is any change in git index + let has_changes = !git::check_git_repository_clean()?; + if has_changes { + let commit_message = format!("Release Vector {vector_version}"); + git::commit(&commit_message)?; + } + git::push()?; + + // Remove temporary directory + td.close()?; + Ok(()) + } +} + +// Open the vector.rb file and update the new content +fn update_content(file_path: &Path, package_url: &str, package_sha256: &str, vector_version: &str) -> Result { + let content = std::fs::read_to_string(file_path)?; + let patterns = [ + (format!(r#"url "{package_url}""#), r#"url ".*""#), + (format!(r#"sha256 "{package_sha256}""#), r#"sha256 ".*""#), + (format!(r#"version "{vector_version}""#), r#"version ".*""#), + ]; + let new_content = substitute(&content, &patterns)?; + Ok(new_content) +} + +fn substitute(content: &str, patterns: &[(String, &str)]) -> Result { + let mut result = content.to_owned(); + for (value, pattern) in patterns { + let re = regex::Regex::new(pattern)?; + result = re.replace_all(&result, value.as_str()).to_string(); + } + Ok(result) +} diff --git a/vdev/src/commands/release/mod.rs b/vdev/src/commands/release/mod.rs index a1f1c2ca96509..1ab6daeff0f9c 100644 --- a/vdev/src/commands/release/mod.rs +++ b/vdev/src/commands/release/mod.rs @@ -5,7 +5,7 @@ crate::cli_subcommands! { commit, docker, mod github, - homebrew, + mod homebrew, mod prepare, push, s3, @@ -23,10 +23,6 @@ crate::script_wrapper! { docker = "Build the Vector docker images and optionally push it to the registry" => "build-docker.sh" } -crate::script_wrapper! { - homebrew = "Releases latest version to the vectordotdev homebrew tap" - => "release-homebrew.sh" -} crate::script_wrapper! { push = "Pushes new versions produced by `make release` to the repository" => "release-push.sh" diff --git a/vdev/src/git.rs b/vdev/src/git.rs index 5494d77376ed1..d337b15df208c 100644 --- a/vdev/src/git.rs +++ b/vdev/src/git.rs @@ -1,6 +1,6 @@ -use std::{collections::HashSet, process::Command}; +use std::{collections::HashSet, process::Command, process::Output}; -use anyhow::Result; +use anyhow::{anyhow, Result}; use crate::app::CommandExt as _; @@ -63,6 +63,62 @@ pub fn get_modified_files() -> Result> { Ok(capture_output(&args)?.lines().map(str::to_owned).collect()) } +pub fn set_config_values(config_values: Vec<(&str, &str)>) -> Result { + let mut args = Vec::new(); + args.push("config"); + // args.push("--global"); + + for (key, value) in config_values { + args.push(key); + args.push(value); + } + + capture_output(&args) +} + +// Checks if the current directory's repo is clean +pub fn check_git_repository_clean() -> Result { + let output = Command::new("git") + .arg("diff-index") + .arg("--quiet") + .arg("HEAD") + .output() + .map_err(|e| anyhow!("{}", e))?; + + Ok(output.status.success()) +} + +// Commits changes from the current repo +pub fn commit(commit_message: &str) -> Result { + let output = Command::new("git") + .arg("-am") + .arg(commit_message) + .output() + .map_err(|e| anyhow!("{}", e))?; + + Ok(output) +} + +// Pushes changes from the current repo +pub fn push() -> Result { + let output = Command::new("git") + .arg("push") + .output() + .map_err(|e| anyhow!("{}", e))?; + + Ok(output) +} + +pub fn clone(repo_url: &str) -> Result { + let output = Command::new("git") + .arg("clone") + .arg(repo_url) + .output() + .map_err(|e| anyhow!("{}", e))?; + + Ok(output) +} + fn capture_output(args: &[&str]) -> Result { Command::new("git").in_repo().args(args).capture_output() } From 635c990a072028ed95952af0584e25d581cb0b1d Mon Sep 17 00:00:00 2001 From: jonathanpv Date: Wed, 15 Mar 2023 09:41:38 -0400 Subject: [PATCH 2/6] refactor functions and add wrapper for run_command --- vdev/src/commands/release/homebrew.rs | 29 ++++++++------- vdev/src/git.rs | 51 +++++++++++++++------------ 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/vdev/src/commands/release/homebrew.rs b/vdev/src/commands/release/homebrew.rs index 0d88e61092573..22f705147391e 100644 --- a/vdev/src/commands/release/homebrew.rs +++ b/vdev/src/commands/release/homebrew.rs @@ -1,10 +1,10 @@ use anyhow::{Result}; -use std::env; +use std::{env, path::PathBuf}; use tempfile::TempDir; use crate::git; use hex; use sha2::Digest; -use reqwest::blocking::get; +use reqwest; use std::path::Path; use regex; @@ -20,7 +20,7 @@ impl Cli { env::set_current_dir(td.path())?; // Set git configurations - let config_values = vec![ + let config_values = &[ ("user.name", "vic"), ("user.email", "vector@datadoghq.com"), ]; @@ -28,7 +28,7 @@ impl Cli { let github_token = env::var("GITHUB_TOKEN")?; // Clone the homebrew-brew repository - let homebrew_dir = td.path().join("homebrew-brew"); + let homebrew_dir = PathBuf::from("/homebrew-brew"); let homebrew_repo = format!("https://{github_token}:x-oauth-basic@github.com/vectordotdev/homebrew-brew"); git::clone(&homebrew_repo)?; env::set_current_dir(&homebrew_dir)?; @@ -37,12 +37,11 @@ impl Cli { // TODO: use app::version() when it's checked in to master, currently in another PR here: https://github.com/vectordotdev/vector/pull/16724/files#diff-492220caf4fa036bb031d00a23eaa01aa4a0fd5636b2a789bd18f3ce184ede21 let vector_version = env::var("VECTOR_VERSION")?; let package_url = format!("https://packages.timber.io/vector/{vector_version}/vector-{vector_version}-x86_64-apple-darwin.tar.gz"); - let package_sha256 = hex::encode(sha2::Sha256::digest(get(&package_url)?.bytes()?)); + let package_sha256 = hex::encode(sha2::Sha256::digest(reqwest::blocking::get(&package_url)?.bytes()?)); // Update content of Formula/vector.rb let file_path = homebrew_dir.join("Formula").join("vector.rb"); - let new_content = update_content(file_path.as_path(), &package_url, &package_sha256, &vector_version)?; - std::fs::write(file_path, new_content)?; + update_content(file_path.as_path(), &package_url, &package_sha256, &vector_version)?; // Check if there is any change in git index let has_changes = !git::check_git_repository_clean()?; @@ -59,22 +58,22 @@ impl Cli { } // Open the vector.rb file and update the new content -fn update_content(file_path: &Path, package_url: &str, package_sha256: &str, vector_version: &str) -> Result { +fn update_content(file_path: &Path, package_url: &str, package_sha256: &str, vector_version: &str) -> Result<()> { let content = std::fs::read_to_string(file_path)?; let patterns = [ (format!(r#"url "{package_url}""#), r#"url ".*""#), (format!(r#"sha256 "{package_sha256}""#), r#"sha256 ".*""#), (format!(r#"version "{vector_version}""#), r#"version ".*""#), ]; - let new_content = substitute(&content, &patterns)?; - Ok(new_content) + let new_content = substitute(content, &patterns); + std::fs::write(file_path, new_content)?; + Ok(()) } -fn substitute(content: &str, patterns: &[(String, &str)]) -> Result { - let mut result = content.to_owned(); +fn substitute(mut content: String, patterns: &[(String, &str)]) -> String { for (value, pattern) in patterns { - let re = regex::Regex::new(pattern)?; - result = re.replace_all(&result, value.as_str()).to_string(); + let re = regex::Regex::new(pattern).unwrap(); + content = re.replace_all(&content, value.as_str()).to_string(); } - Ok(result) + content } diff --git a/vdev/src/git.rs b/vdev/src/git.rs index d337b15df208c..586bf8040bc25 100644 --- a/vdev/src/git.rs +++ b/vdev/src/git.rs @@ -1,6 +1,6 @@ use std::{collections::HashSet, process::Command, process::Output}; -use anyhow::{anyhow, Result}; +use anyhow::{anyhow, Result, Context}; use crate::app::CommandExt as _; @@ -51,7 +51,7 @@ pub fn list_files() -> Result> { .collect()) } -// Get a list of files that have been modified, as a vector of strings +/// Get a list of files that have been modified, as a vector of strings pub fn get_modified_files() -> Result> { let args = vec![ "ls-files", @@ -63,10 +63,8 @@ pub fn get_modified_files() -> Result> { Ok(capture_output(&args)?.lines().map(str::to_owned).collect()) } -pub fn set_config_values(config_values: Vec<(&str, &str)>) -> Result { - let mut args = Vec::new(); - args.push("config"); - // args.push("--global"); +pub fn set_config_values(config_values: &[(&str, &str)]) -> Result { + let mut args = vec!["config"]; for (key, value) in config_values { args.push(key); @@ -76,30 +74,22 @@ pub fn set_config_values(config_values: Vec<(&str, &str)>) -> Result { capture_output(&args) } -// Checks if the current directory's repo is clean +/// Checks if the current directory's repo is clean pub fn check_git_repository_clean() -> Result { - let output = Command::new("git") - .arg("diff-index") - .arg("--quiet") - .arg("HEAD") - .output() - .map_err(|e| anyhow!("{}", e))?; - - Ok(output.status.success()) + Ok(Command::new("git") + .args(["diff-index", "--quiet", "HEAD"]) + .stdout(std::process::Stdio::null()) + .status() + .map(|status| status.success())?) } -// Commits changes from the current repo +/// Commits changes from the current repo pub fn commit(commit_message: &str) -> Result { - let output = Command::new("git") - .arg("-am") - .arg(commit_message) - .output() - .map_err(|e| anyhow!("{}", e))?; - + let output = run_command_check_status(&["-am", commit_message])?; Ok(output) } -// Pushes changes from the current repo +/// Pushes changes from the current repo pub fn push() -> Result { let output = Command::new("git") .arg("push") @@ -123,6 +113,21 @@ fn capture_output(args: &[&str]) -> Result { Command::new("git").in_repo().args(args).capture_output() } +// TODO: Potentially modify capture_output function with this implementation if it satisfies the use case +fn run_command_check_status(args: &[&str]) -> Result { + let mut command = Command::new("git"); + command.args(args); + + let output = command.output().context(format!("Failed to run command: git {:?}", args))?; + let status = output.status; + if !status.success() { + return Err(anyhow!("Command failed with exit code: {status}")); + } + + Ok(output) +} + + fn is_warning_line(line: &str) -> bool { line.starts_with("warning: ") || line.contains("original line endings") } From 92c08fef606a7154db3a4643841f3ae990d08914 Mon Sep 17 00:00:00 2001 From: jonathanpv Date: Wed, 15 Mar 2023 22:14:50 -0400 Subject: [PATCH 3/6] remove wrapper call of capture_output, use correct paths in homebrew.rs --- vdev/src/commands/release/homebrew.rs | 18 +++++----- vdev/src/git.rs | 47 +++++++-------------------- 2 files changed, 21 insertions(+), 44 deletions(-) diff --git a/vdev/src/commands/release/homebrew.rs b/vdev/src/commands/release/homebrew.rs index 22f705147391e..f8ac81afbfa58 100644 --- a/vdev/src/commands/release/homebrew.rs +++ b/vdev/src/commands/release/homebrew.rs @@ -1,5 +1,5 @@ use anyhow::{Result}; -use std::{env, path::PathBuf}; +use std::env; use tempfile::TempDir; use crate::git; use hex; @@ -28,20 +28,17 @@ impl Cli { let github_token = env::var("GITHUB_TOKEN")?; // Clone the homebrew-brew repository - let homebrew_dir = PathBuf::from("/homebrew-brew"); let homebrew_repo = format!("https://{github_token}:x-oauth-basic@github.com/vectordotdev/homebrew-brew"); git::clone(&homebrew_repo)?; - env::set_current_dir(&homebrew_dir)?; + env::set_current_dir("homebrew-brew")?; // Get package details for updating Formula/vector.rb - // TODO: use app::version() when it's checked in to master, currently in another PR here: https://github.com/vectordotdev/vector/pull/16724/files#diff-492220caf4fa036bb031d00a23eaa01aa4a0fd5636b2a789bd18f3ce184ede21 let vector_version = env::var("VECTOR_VERSION")?; let package_url = format!("https://packages.timber.io/vector/{vector_version}/vector-{vector_version}-x86_64-apple-darwin.tar.gz"); let package_sha256 = hex::encode(sha2::Sha256::digest(reqwest::blocking::get(&package_url)?.bytes()?)); // Update content of Formula/vector.rb - let file_path = homebrew_dir.join("Formula").join("vector.rb"); - update_content(file_path.as_path(), &package_url, &package_sha256, &vector_version)?; + update_content("Formula/vector.rb", &package_url, &package_sha256, &vector_version)?; // Check if there is any change in git index let has_changes = !git::check_git_repository_clean()?; @@ -57,9 +54,12 @@ impl Cli { } } -// Open the vector.rb file and update the new content -fn update_content(file_path: &Path, package_url: &str, package_sha256: &str, vector_version: &str) -> Result<()> { - let content = std::fs::read_to_string(file_path)?; +/// Open the vector.rb file and update the new content +fn update_content

(file_path: P, package_url: &str, package_sha256: &str, vector_version: &str) -> Result<()> +where + P: AsRef, +{ + let content = std::fs::read_to_string(&file_path)?; let patterns = [ (format!(r#"url "{package_url}""#), r#"url ".*""#), (format!(r#"sha256 "{package_sha256}""#), r#"sha256 ".*""#), diff --git a/vdev/src/git.rs b/vdev/src/git.rs index 586bf8040bc25..7b0f767740829 100644 --- a/vdev/src/git.rs +++ b/vdev/src/git.rs @@ -1,6 +1,6 @@ -use std::{collections::HashSet, process::Command, process::Output}; +use std::{collections::HashSet, process::Command}; -use anyhow::{anyhow, Result, Context}; +use anyhow::Result; use crate::app::CommandExt as _; @@ -84,50 +84,27 @@ pub fn check_git_repository_clean() -> Result { } /// Commits changes from the current repo -pub fn commit(commit_message: &str) -> Result { - let output = run_command_check_status(&["-am", commit_message])?; - Ok(output) +pub fn commit(commit_message: &str) -> Result { + Command::new("git") + .args(["-am", commit_message]) + .capture_output() } /// Pushes changes from the current repo -pub fn push() -> Result { - let output = Command::new("git") - .arg("push") - .output() - .map_err(|e| anyhow!("{}", e))?; - - Ok(output) +pub fn push() -> Result { + Command::new("git").arg("push").capture_output() } -pub fn clone(repo_url: &str) -> Result { - let output = Command::new("git") - .arg("clone") - .arg(repo_url) - .output() - .map_err(|e| anyhow!("{}", e))?; - - Ok(output) +pub fn clone(repo_url: &str) -> Result { + Command::new("git") + .args(["clone", repo_url]) + .capture_output() } fn capture_output(args: &[&str]) -> Result { Command::new("git").in_repo().args(args).capture_output() } -// TODO: Potentially modify capture_output function with this implementation if it satisfies the use case -fn run_command_check_status(args: &[&str]) -> Result { - let mut command = Command::new("git"); - command.args(args); - - let output = command.output().context(format!("Failed to run command: git {:?}", args))?; - let status = output.status; - if !status.success() { - return Err(anyhow!("Command failed with exit code: {status}")); - } - - Ok(output) -} - - fn is_warning_line(line: &str) -> bool { line.starts_with("warning: ") || line.contains("original line endings") } From 11a38cf612d062bb667d0544ef748ff0eceab319 Mon Sep 17 00:00:00 2001 From: jonathanpv Date: Tue, 21 Mar 2023 13:43:47 -0400 Subject: [PATCH 4/6] use capture_output on some git helper functions --- vdev/src/git.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vdev/src/git.rs b/vdev/src/git.rs index d89b061674a6b..0bfd85fcb0d83 100644 --- a/vdev/src/git.rs +++ b/vdev/src/git.rs @@ -109,17 +109,16 @@ pub fn check_git_repository_clean() -> Result { /// Commits changes from the current repo pub fn commit(commit_message: &str) -> Result { - Command::new("git") - .args(["-am", commit_message]) - .capture_output() + capture_output(&["commit", "--all", "--message", commit_message]) } /// Pushes changes from the current repo pub fn push() -> Result { - Command::new("git").arg("push").capture_output() + capture_output(&["push"]) } pub fn clone(repo_url: &str) -> Result { + // We cannot use capture_output since this will need to run in the CWD Command::new("git") .args(["clone", repo_url]) .capture_output() From f79185db12984a664f4324b6e8960ea5bdb5e108 Mon Sep 17 00:00:00 2001 From: jonathanpv Date: Fri, 31 Mar 2023 00:23:47 -0400 Subject: [PATCH 5/6] use check_output() instead of capture_output() --- vdev/src/git.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vdev/src/git.rs b/vdev/src/git.rs index 241734d286492..d82622a20fcee 100644 --- a/vdev/src/git.rs +++ b/vdev/src/git.rs @@ -99,7 +99,7 @@ pub fn set_config_values(config_values: &[(&str, &str)]) -> Result { args.push(value); } - capture_output(&args) + check_output(&args) } /// Checks if the current directory's repo is clean @@ -113,19 +113,19 @@ pub fn check_git_repository_clean() -> Result { /// Commits changes from the current repo pub fn commit(commit_message: &str) -> Result { - capture_output(&["commit", "--all", "--message", commit_message]) + check_output(&["commit", "--all", "--message", commit_message]) } /// Pushes changes from the current repo pub fn push() -> Result { - capture_output(&["push"]) + check_output(&["push"]) } pub fn clone(repo_url: &str) -> Result { // We cannot use capture_output since this will need to run in the CWD Command::new("git") .args(["clone", repo_url]) - .capture_output() + .check_output() } pub fn branch_exists(branch_name: &str) -> Result { From c8f817869108ab5f2dabb132a572649a9686a4d2 Mon Sep 17 00:00:00 2001 From: jonathanpv Date: Sat, 1 Apr 2023 21:42:47 -0400 Subject: [PATCH 6/6] check fmt --- vdev/src/git.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vdev/src/git.rs b/vdev/src/git.rs index d82622a20fcee..0da65d4217da4 100644 --- a/vdev/src/git.rs +++ b/vdev/src/git.rs @@ -123,9 +123,7 @@ pub fn push() -> Result { pub fn clone(repo_url: &str) -> Result { // We cannot use capture_output since this will need to run in the CWD - Command::new("git") - .args(["clone", repo_url]) - .check_output() + Command::new("git").args(["clone", repo_url]).check_output() } pub fn branch_exists(branch_name: &str) -> Result {