aboutsummaryrefslogtreecommitdiff
path: root/doc/special_remotes
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-08-17 16:20:09 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-08-17 16:20:09 -0400
commit69cdbd3ce6bda7404e37e48059f30158d92a1319 (patch)
tree5fe3dcbc6bbcc9092e2dd88c486e30f9d6e2d313 /doc/special_remotes
parente50372f632de988bbe48173081ba0367d7790193 (diff)
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.
Diffstat (limited to 'doc/special_remotes')
-rwxr-xr-xdoc/special_remotes/external/example.sh6
-rwxr-xr-xdoc/special_remotes/external/git-annex-remote-ipfs6
-rwxr-xr-xdoc/special_remotes/external/git-annex-remote-torrent6
3 files changed, 12 insertions, 6 deletions
diff --git a/doc/special_remotes/external/example.sh b/doc/special_remotes/external/example.sh
index 8fed9f4aa..ed37ad9ec 100755
--- a/doc/special_remotes/external/example.sh
+++ b/doc/special_remotes/external/example.sh
@@ -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.
diff --git a/doc/special_remotes/external/git-annex-remote-ipfs b/doc/special_remotes/external/git-annex-remote-ipfs
index c8d97ef5c..f255f9bc5 100755
--- a/doc/special_remotes/external/git-annex-remote-ipfs
+++ b/doc/special_remotes/external/git-annex-remote-ipfs
@@ -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
diff --git a/doc/special_remotes/external/git-annex-remote-torrent b/doc/special_remotes/external/git-annex-remote-torrent
index 4df1f8154..d7897d772 100755
--- a/doc/special_remotes/external/git-annex-remote-torrent
+++ b/doc/special_remotes/external/git-annex-remote-torrent
@@ -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"
;;