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