这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions scripts/termux-share
Original file line number Diff line number Diff line change
Expand Up @@ -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