From ffb03490d55e6b752ceb15949bdcde75a3d33c44 Mon Sep 17 00:00:00 2001 From: Vladimir Ulianitsky <47718845+uvlad7@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:39:33 +0300 Subject: [PATCH] Update cargo-binstall for JRuby --- cargo-binstall/cargo-binstall | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/cargo-binstall/cargo-binstall b/cargo-binstall/cargo-binstall index 1d313d5..1957fd2 100755 --- a/cargo-binstall/cargo-binstall +++ b/cargo-binstall/cargo-binstall @@ -79,8 +79,10 @@ def download_and_save(triple) system("unzip -p #{zipfile} #{filename} > #{outfile}") FileUtils.rm(zipfile) elsif ext == "tgz" - content = pipe_command("tar xzf - -O", stdin: response.body) - File.binwrite(outfile, content) + zipfile = File.join(tmpdir, 'cargo-binstall.tgz') + File.binwrite(zipfile, response.body) + system("tar xzf #{zipfile} -O > #{outfile}") + FileUtils.rm(zipfile) end ret = outfile @@ -88,16 +90,6 @@ def download_and_save(triple) ret end -def pipe_command(cmd, stdin:) - require "open3" - - stdout_and_stderr_str, status = Open3.capture2e(cmd, stdin_data: stdin) - - abort(stdout_and_stderr_str) unless status.success? - - stdout_and_stderr_str -end - def install_cargo_binstall puts("::group::Installing cargo-binstall") target_triple = infer_target_triple