Merge pull request #199 from vaites/byobu
[termux-packages] / packages / termux-api / termux-share
index e083272..1c08188 100755 (executable)
@@ -1,4 +1,4 @@
-#!/system/bin/sh
+#!/bin/sh
 
 show_usage () {
        echo "usage: termux-share [options] [file]"
@@ -43,6 +43,10 @@ esac
 done
 
 if [ $# -gt 1 ]; then echo "Only one file can be shared"; exit 1; fi
-if [ $# != 0 ]; then PARAMS="$PARAMS --es file `realpath $1`"; fi
 
-termux-api Share $PARAMS
+if [ $# != 0 ]; then
+       # Note that the file path can contain whitespace.
+        @TERMUX_API@ Share $PARAMS --es file "`realpath "$1"`"
+else
+       @TERMUX_API@ Share $PARAMS
+fi