From c18760060b2a48212e71a9bafcc5d34916de1fe2 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Tue, 26 Feb 2019 13:46:40 +0000 Subject: [PATCH] fix: show interactive output from install.sh When trying out the latest rc, i used the `./install.sh` It hung, with no output. I removed the 2> /dev/null and it turned out mv was waiting for user input to confirm the change of file permssions from 555 to 755. This PR removes piping the output from mv to /dev/null as it seems like the safest fix. An alternative would be to just add -f but i've err'd on the side of caution. If also tweaked the second condition basedo on the recommendations of shellcheck see: https://github.com/koalaman/shellcheck/wiki/SC2166 License: MIT Signed-off-by: Oli Evans --- cmd/ipfs/dist/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ipfs/dist/install.sh b/cmd/ipfs/dist/install.sh index daf7185b460..08f68752342 100755 --- a/cmd/ipfs/dist/install.sh +++ b/cmd/ipfs/dist/install.sh @@ -13,11 +13,11 @@ binpaths="/usr/local/bin /usr/bin" is_write_perm_missing="" for binpath in $binpaths; do - if mv "$bin" "$binpath/$bin" 2> /dev/null; then + if mv "$bin" "$binpath/$bin" ; then echo "Moved $bin to $binpath" exit 0 else - if [ -d "$binpath" -a ! -w "$binpath" ]; then + if [ -d "$binpath" ] && [ ! -w "$binpath" ]; then is_write_perm_missing=1 fi fi