fix external script for filenames with spaces from protocol

Fix the external special remotes git-annex-remote-ipfs,
git-annex-remote-torrent and the example.sh template to correctly support
filenames with spaces.

This commit was sponsored by John Peloquin on Patreon.
This commit is contained in:
Joey Hess 2017-08-17 16:20:09 -04:00
parent dafafad115
commit fdbfe88168
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 15 additions and 6 deletions

View file

@ -122,9 +122,11 @@ while read line; do
fi
;;
TRANSFER)
op="$2"
key="$3"
file="$4"
case "$2" in
shift 3
file="$@"
case "$op" in
STORE)
# Store the file to a location
# based on the key.

View file

@ -81,9 +81,11 @@ while read line; do
echo CHECKURL-CONTENTS UNKNOWN "$(urltoaddress "$url")"
;;
TRANSFER)
op="$2"
key="$3"
file="$4"
case "$2" in
shift 3
file="$@"
case "$op" in
STORE)
addr=$(ipfs add -q "$file" </dev/null) || true
if [ -z "$addr" ]; then

View file

@ -149,9 +149,11 @@ while read line; do
rm -f "$tmp"
;;
TRANSFER)
op="$2"
key="$3"
file="$4"
case "$2" in
shift 3
file="$@"
case "$op" in
STORE)
echo TRANSFER-FAILURE STORE "$key" "upload not supported"
;;