Commits

Roger Pate committed 1907602

Use if/then/fi instead of &&
HG: Enter/resume commit message. Lines beginning with 'HG:' are removed.
HG: You can save this message, and edit it again later before committing.
HG: After exiting the editor, you will return to the crecord patch view.
HG: --
HG: user: Roger Pate <roger@qxxy.com>

Comments (0)

Files changed (1)

     builtin cd -- "$R"
   }
 }
-which xdir >/dev/null && alias cd=cds
-which xdir >/dev/null && function pd {
-  case $# in
-    0)
-      pushd ~
-      return
-      ;;
-    1)
-      case "$1" in
-        [-+]*)
-          pushd "$@"
-          return
-          ;;
-      esac
-  esac
-  local R=$(xdir --cdpath=${CDPATH:-.} "$@")
-  [ $? -eq 0 -a -d "$R" ] && pushd "$R"
-}
+if which xdir >/dev/null; then
+  alias cd=cds
+fi
+if which xdir >/dev/null; then
+  function pd {
+    case $# in
+      0)
+        pushd ~
+        return
+        ;;
+      1)
+        case "$1" in
+          [-+]*)
+            pushd "$@"
+            return
+            ;;
+        esac
+    esac
+    local R=$(xdir --cdpath=${CDPATH:-.} "$@")
+    if [ $? -eq 0 -a -d "$R" ]; then
+      pushd -- "$R"
+    fi
+  }
+else
+  alias pd=pushd
+fi
 
 
 # http://www.cmdln.org/2010/05/20/bash-historyfu/