local/bin/rshare: Always use woof when sharing a single file.

master
Pierre Neidhardt 2020-07-18 15:17:29 +02:00
parent ac1587b63d
commit 7681ac5f58
1 changed files with 9 additions and 7 deletions

View File

@ -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