From 7681ac5f587288b9234e38c408715022a8896de2 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sat, 18 Jul 2020 15:17:29 +0200 Subject: [PATCH] local/bin/rshare: Always use woof when sharing a single file. --- .local/bin/rshare | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.local/bin/rshare b/.local/bin/rshare index 8a3be5d2..885fef54 100755 --- a/.local/bin/rshare +++ b/.local/bin/rshare @@ -76,7 +76,11 @@ EOF } share_woof() { - woof -c 9999 -p $PORT "$TARGET" + if command -v guix >/dev/null 2>&1; then + guix environment -C -N --ad-hoc woof -- woof -c 9999 -p $PORT "$TARGET" + else + woof -c 9999 -p $PORT "$TARGET" + fi } share_python() { @@ -91,12 +95,10 @@ share_python() { fi } -if $OPT_HTTP; then - if [ -f "$TARGET" ]; then - share_woof "$TARGET" - else - share_python "$TARGET" - fi +if [ -f "$TARGET" ]; then + share_woof "$TARGET" +elif $OPT_HTTP; then + share_python "$TARGET" else share_rsync fi