Skip to content

Commit

Permalink
Removed dependency on xargs
Browse files Browse the repository at this point in the history
  • Loading branch information
janpfeifer committed Nov 26, 2024
1 parent 5736967 commit 9b90798
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/install_darwin_amd64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ _SUDO="sudo"
if [[ "${GOPJRT_NOSUDO}" != "" ]] ; then
echo " - Not using sudo during installation, disabled with GOPJRT_NOSUDO != ''."
_SUDO=""
elif command -v sudo ; then
elif command -v sudo > /dev/null ; then
echo " - Using sudo when extracting files to final destination (Set GOPJRT_NOSUDO=1 if you don't want sudo to be used)"
else
echo " - Not using sudo during installation, no program 'sudo' found in PATH."
Expand Down
2 changes: 1 addition & 1 deletion cmd/install_darwin_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ _SUDO="sudo"
if [[ "${GOPJRT_NOSUDO}" != "" ]] ; then
echo " - Not using sudo during installation, disabled with GOPJRT_NOSUDO != ''."
_SUDO=""
elif command -v sudo ; then
elif command -v sudo > /dev/null ; then
echo " - Using sudo when extracting files to final destination (Set GOPJRT_NOSUDO=1 if you don't want sudo to be used)"
else
echo " - Not using sudo during installation, no program 'sudo' found in PATH."
Expand Down
12 changes: 8 additions & 4 deletions cmd/install_linux_amd64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ _SUDO="sudo"
if [[ "${GOPJRT_NOSUDO}" != "" ]] ; then
echo " - Not using sudo during installation, disabled with GOPJRT_NOSUDO != ''."
_SUDO=""
elif command -v sudo ; then
elif command -v sudo > /dev/null ; then
echo " - Using sudo when extracting files to final destination (Set GOPJRT_NOSUDO=1 if you don't want sudo to be used)"
else
echo " - Not using sudo during installation, no program 'sudo' found in PATH."
Expand Down Expand Up @@ -60,9 +60,13 @@ if [[ "${_SUDO}" != "" ]] ; then
echo "Checking sudo authorization for installation"
${_SUDO} printf "\tsudo authorized\n"
fi
set -o pipefail
${_SUDO} tar xvzf "${tar_file}" | xargs ls -ldh
rm -f "${tar_file}"

list_files=$(mktemp --tmpdir gopjrt_list_files.XXXXXXXX)
${_SUDO} tar xvzf "${tar_file}" > "${list_files}"
ls -lhd $(cat "${list_files}")

# Clean up temporary files.
rm -f "${tar_file}" "${list_files}"

# Remove older version using dynamically linked library -- it would be picked up on this otherwise and fail to link.
# (Remove these lines after v0.5.x).
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Next

* Fixed installation scripts: s/sudo/$_SUDO. Also made them more verbose.
* Removed dependency on `xargs` in installation script for Linux.

# v0.4.9 - 2024-11-25

Expand Down

0 comments on commit 9b90798

Please sign in to comment.