aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar http://johan.kiviniemi.name/ <Johan@web>2014-04-23 21:28:59 +0000
committerGravatar admin <admin@branchable.com>2014-04-23 21:28:59 +0000
commitc1d4cf090367e814609a2e7ccf5bde85e6a8afda (patch)
treeedb4cc5c24804140ea6f7e8a1e009ea8ceb48742
parent1883edd4e9fd0fff00494d1c39a984095c3a45d1 (diff)
OSX script: Fix formatting; safe variable expansion with ""; use &&
-rw-r--r--doc/tips/file_manager_integration.mdwn13
1 files changed, 6 insertions, 7 deletions
diff --git a/doc/tips/file_manager_integration.mdwn b/doc/tips/file_manager_integration.mdwn
index 19e404e22..6c6ac643f 100644
--- a/doc/tips/file_manager_integration.mdwn
+++ b/doc/tips/file_manager_integration.mdwn
@@ -90,13 +90,12 @@ For OS X, it is possible to get context menus in Finder. Due to how OS X deals w
2. Using the Drop down menus in the top create the sentence "Service receives selected folders in Finder.app" to have it work on folders. For direct mode operation it is probably reasonable to select "files or folders".
3. Add a "Run shell script" element and fill in line with the following script:
-
- #!/usr/bin/bash
- source ~/.bash_profile
- for f in "$@"
- do
- cd $(dirname $f); git-annex get $f
- done
+ #!/usr/bin/bash
+ source ~/.bash_profile
+ for f in "$@"
+ do
+ cd "$(dirname "$f")" && git-annex get "$f"
+ done
The purpose of the first line is there to get git-annex on to the path. The reason for the for loop is in case multiple files or folders are marked when running the context menu command.