Merge pull request #53 from tomty89/app_995

termux-share: companion of termux/termux-api#253
This commit is contained in:
Fredrik Fornwall 2019-05-30 00:43:04 +02:00 committed by GitHub
commit 7a1b7cb120
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,16 +42,13 @@ shift $(($OPTIND-1))
if [ $# -gt 1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
if [ $# != 0 ]; then
FILE="$1"
if [ -f "$FILE" ]; then
FILE=`realpath "$FILE"`
if [ ! -f "$1" ]; then
echo "$1 is not a file"
exit 1
fi
# Fix for issues on Android 8.1.
FILE=$(echo "$FILE" | sed 's/^\///')
# Note that the file path can contain whitespace.
/data/data/com.termux/files/usr/libexec/termux-api Share $PARAMS --es file "$FILE"
/data/data/com.termux/files/usr/libexec/termux-api Share $PARAMS --es file "$(realpath "$1")"
else
/data/data/com.termux/files/usr/libexec/termux-api Share $PARAMS
fi