jpillora / installer

One-liner for installing binaries from Github releases
https://i.jpillora.com/installer
MIT License
206 stars 52 forks source link

add 'sudo mv' as fallback #3

Closed milahu closed 5 years ago

milahu commented 5 years ago

when i run install.sh as user, then mv $TMP_BIN $OUT_DIR/$PROG fails with Permission denied with OUT_DIR="/usr/local/bin"

now, if mv fails, fall back to 'sudo mv'

to fix issue https://github.com/jpillora/cloud-torrent/issues/270

jpillora commented 5 years ago

Thanks!

hknerdr commented 5 years ago

Hi, So any update on this? i still get mv:failed error.

milahu commented 5 years ago

for debugging, add a -v flag to mv

    mv -v $TMP_BIN $OUT_DIR/$PROG \
    || sudo mv -v $TMP_BIN $OUT_DIR/$PROG \
    || fail "mv failed" #FINAL STEP!