about summary refs log tree commit diff
path: root/configs
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2019-03-23T16·38+0000
committerWilliam Carroll <wpcarro@gmail.com>2019-03-23T16·38+0000
commitf5ace0b0a92e05fd4d1466556f2fd98ad4e6b776 (patch)
treefd02de2844bb3d8736dd397aa4f2e4a02961095f /configs
parent7167764622d231da33239293925caa3e940721c7 (diff)
Prefer $(pwd) to $PWD
I'm unsure if this is idiomatic POSIX shell scripting or not, but I generally
prefer function calls to variables. Thankfully things like Haskell don't
differentiate between the two. In other cold and hostile environments like shell
scripting, us programmers must take care to prefer functions to variables where
it makes sense.
Diffstat (limited to 'configs')
-rw-r--r--configs/shared/zsh/functions.zsh2
1 files changed, 1 insertions, 1 deletions
diff --git a/configs/shared/zsh/functions.zsh b/configs/shared/zsh/functions.zsh
index 815d90aefd85..3bf892355a92 100644
--- a/configs/shared/zsh/functions.zsh
+++ b/configs/shared/zsh/functions.zsh
@@ -9,7 +9,7 @@ fv() {
 tbz() {
   # Toggle between blaze-bin and your source.
   # Useful if you like to cd into the dir where your source lives.
-  if [[ $PWD =~ '(.*)/blaze-bin(.*)' ]]; then
+  if [[ "$(pwd)" =~ '(.*)/blaze-bin(.*)' ]]; then
     cd "${match[1]}${match[2]}"
   else
     cd "${PWD/\/google3//google3/blaze-bin}"