diff options
author | Robby Russell <robby@planetargon.com> | 2013-04-07 18:58:50 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2013-04-07 18:58:50 -0700 |
commit | 601d4d6efc3babed55cbf90252538080089dcfa5 (patch) | |
tree | 081bc665ec2b810f639cc2c5d3a5e574a0c4dd9b /plugins/last-working-dir | |
parent | ca384067e602ab742d37258816feb6495e24fe90 (diff) | |
parent | 4c8bba57acb0f64edde89321d5d6cbc3a5226cac (diff) | |
download | zsh-601d4d6efc3babed55cbf90252538080089dcfa5.tar.gz zsh-601d4d6efc3babed55cbf90252538080089dcfa5.tar.bz2 zsh-601d4d6efc3babed55cbf90252538080089dcfa5.zip |
Merge pull request #1662 from rylwin/patch-1
last-working-dir: Use >! to overwrite $cache_file
Diffstat (limited to 'plugins/last-working-dir')
-rw-r--r-- | plugins/last-working-dir/last-working-dir.plugin.zsh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh index 190bc279d..ccf0f5b22 100644 --- a/plugins/last-working-dir/last-working-dir.plugin.zsh +++ b/plugins/last-working-dir/last-working-dir.plugin.zsh @@ -9,7 +9,8 @@ local cache_file="$ZSH/cache/last-working-dir" # Updates the last directory once directory is changed. function chpwd() { - echo "$PWD" > "$cache_file" + # Use >! in case noclobber is set to avoid "file exists" error + echo "$PWD" >! "$cache_file" } # Changes directory to the last working directory. |