diff --git a/Cargo.lock b/Cargo.lock index 213a83f2..379a2426 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,7 +89,6 @@ name = "buildpack-heroku-dotnet" version = "0.0.0" dependencies = [ "buildpacks-jvm-shared", - "fun_run", "hex", "indoc", "libcnb", @@ -348,16 +347,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" -[[package]] -name = "fun_run" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1060b826a0883f31399a72e983a55ad0b38830429a5d1dff3719aac9782415" -dependencies = [ - "lazy_static", - "regex", -] - [[package]] name = "generic-array" version = "0.14.7" diff --git a/buildpacks/dotnet/Cargo.toml b/buildpacks/dotnet/Cargo.toml index 4cf945f0..14d5b544 100644 --- a/buildpacks/dotnet/Cargo.toml +++ b/buildpacks/dotnet/Cargo.toml @@ -10,7 +10,6 @@ autotests = false workspace = true [dependencies] -fun_run = "0.2.0" hex = "0.4" indoc = "2" libcnb = "0.26" diff --git a/buildpacks/dotnet/src/main.rs b/buildpacks/dotnet/src/main.rs index 5cb779de..c240d27c 100644 --- a/buildpacks/dotnet/src/main.rs +++ b/buildpacks/dotnet/src/main.rs @@ -23,7 +23,6 @@ use buildpacks_jvm_shared::output::{ print_buildpack_name, print_section, print_subsection, print_warning, run_command, track_timing, BuildpackOutputTextSection, }; -use fun_run::CommandWithName; use indoc::formatdoc; use inventory::artifact::{Arch, Os}; use inventory::{Inventory, ParseInventoryError}; @@ -153,7 +152,7 @@ impl Buildpack for DotnetBuildpack { print_subsection(vec![ BuildpackOutputTextSection::regular("Running "), - BuildpackOutputTextSection::Command(publish_command.name()), + BuildpackOutputTextSection::Command(command_to_string(&publish_command)), ]); track_timing(|| { run_command( @@ -199,6 +198,15 @@ impl Buildpack for DotnetBuildpack { } } +fn command_to_string(cmd: &Command) -> String { + let mut result = cmd.get_program().to_string_lossy().to_string(); + for arg in cmd.get_args() { + result.push(' '); + result.push_str(&arg.to_string_lossy()); + } + result +} + fn get_solution_to_publish(app_dir: &Path) -> Result { let solution_file_paths = detect::solution_file_paths(app_dir).expect("function to pass after detection"); diff --git a/buildpacks/dotnet/tests/dotnet_publish_test.rs b/buildpacks/dotnet/tests/dotnet_publish_test.rs index 4b15f839..147343a6 100644 --- a/buildpacks/dotnet/tests/dotnet_publish_test.rs +++ b/buildpacks/dotnet/tests/dotnet_publish_test.rs @@ -98,7 +98,7 @@ fn test_dotnet_publish_with_global_json_and_custom_verbosity_level() { &formatdoc! {r#" - Publish solution - Using `Release` build configuration - - Running dotnet publish /workspace/foo.csproj --runtime {rid} "-p:PublishDir=bin/publish" --verbosity normal + - Running dotnet publish /workspace/foo.csproj --runtime {rid} -p:PublishDir=bin/publish --verbosity normal MSBuild version 17.8.3+195e7f5a3 for .NET Build started . 1>Project "/workspace/foo.csproj" on node 1 (Restore target(s)).