We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a6e432b + 689e3f9 commit 7a1b7cbCopy full SHA for 7a1b7cb
1 file changed
scripts/termux-share
@@ -42,16 +42,13 @@ shift $(($OPTIND-1))
42
if [ $# -gt 1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
43
44
if [ $# != 0 ]; then
45
- FILE="$1"
46
- if [ -f "$FILE" ]; then
47
- FILE=`realpath "$FILE"`
+ if [ ! -f "$1" ]; then
+ echo "$1 is not a file"
+ exit 1
48
fi
49
50
- # Fix for issues on Android 8.1.
51
- FILE=$(echo "$FILE" | sed 's/^\///')
52
-
53
# Note that the file path can contain whitespace.
54
- /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")"
55
else
56
/data/data/com.termux/files/usr/libexec/termux-api Share $PARAMS
57
0 commit comments