aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/mkcd.sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-11 14:52:11 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-11 14:52:11 +1300
commit6e8c6c521ae5d60427634be01b82fe61a79f192b (patch)
tree5349fc3e9838c69dbb6fd69f0234ea921ea446ea /sh/shrc.d/mkcd.sh
parentFactor out zsh ENV hack into one file (diff)
downloaddotfiles-6e8c6c521ae5d60427634be01b82fe61a79f192b.tar.gz
dotfiles-6e8c6c521ae5d60427634be01b82fe61a79f192b.zip
Refactor some conditionals
Diffstat (limited to 'sh/shrc.d/mkcd.sh')
-rw-r--r--sh/shrc.d/mkcd.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/sh/shrc.d/mkcd.sh b/sh/shrc.d/mkcd.sh
index c59a8c54..cd882b51 100644
--- a/sh/shrc.d/mkcd.sh
+++ b/sh/shrc.d/mkcd.sh
@@ -1,4 +1,5 @@
# Create a directory and change into it
mkcd() {
- mkdir -p -- "$1" && command cd -- "$1"
+ command -p mkdir -p -- "$1" || return
+ command cd -- "$1"
}