73212ded4ee70c010a92eb7a126daa20c7453cba

Author
Elliott Williams <e@elliottwillia.ms>
Committer
Elliott Williams <e@elliottwillia.ms>
Date

Message

Fix osx function: "not valid in this context"

I have been continually having problems with the "trash" function provided by the osx plugin, getting this error:

    trash:local:2: not valid in this context:

It seems like adding quotes around the assignment in [osx.plugin.zsh#L142](https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/osx/osx.plugin.zsh#L142) fixed my problem.

Does this look good to you? Thanks!

Diff

 1diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
 2index a63f0ee053ccbcbf0182660a04991754e1979268..2eea0d8ef1b5de801dd43a03b86d964e30cd2113 100644
 3--- a/plugins/osx/osx.plugin.zsh
 4+++ b/plugins/osx/osx.plugin.zsh
 5@@ -139,7 +139,7 @@ function man-preview() {
 6 
 7 function trash() {
 8   local trash_dir="${HOME}/.Trash"
 9-  local temp_ifs=$IFS
10+  local temp_ifs="$IFS"
11   IFS=$'\n'
12   for item in "$@"; do
13     if [[ -e "$item" ]]; then