X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/1ee4335f4ae1ca268f676c7bed2a9753d083989f..fc45b8e28bdc927f933f41be10a4ebb21a5e9748:/packages/termux-api/termux-share diff --git a/packages/termux-api/termux-share b/packages/termux-api/termux-share index e0832725..1c081888 100755 --- a/packages/termux-api/termux-share +++ b/packages/termux-api/termux-share @@ -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