mirror of
https://github.com/danog/termux-api-package.git
synced 2024-11-30 04:39:01 +01:00
Merge pull request #53 from tomty89/app_995
termux-share: companion of termux/termux-api#253
This commit is contained in:
commit
7a1b7cb120
@ -42,16 +42,13 @@ shift $(($OPTIND-1))
|
|||||||
if [ $# -gt 1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
|
if [ $# -gt 1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
|
||||||
|
|
||||||
if [ $# != 0 ]; then
|
if [ $# != 0 ]; then
|
||||||
FILE="$1"
|
if [ ! -f "$1" ]; then
|
||||||
if [ -f "$FILE" ]; then
|
echo "$1 is not a file"
|
||||||
FILE=`realpath "$FILE"`
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fix for issues on Android 8.1.
|
|
||||||
FILE=$(echo "$FILE" | sed 's/^\///')
|
|
||||||
|
|
||||||
# Note that the file path can contain whitespace.
|
# 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
|
else
|
||||||
/data/data/com.termux/files/usr/libexec/termux-api Share $PARAMS
|
/data/data/com.termux/files/usr/libexec/termux-api Share $PARAMS
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user