Update mkcd
authorMikael Berthe <mikael@lilotux.net>
Wed, 08 May 2019 15:18:39 +0200
changeset 43 7b48c4ff8d36
parent 42 2431e6a9344a
child 44 157f894ef9f7
Update mkcd
zshrc.d/30-functions.zrc
--- a/zshrc.d/30-functions.zrc	Sat Apr 27 22:54:09 2019 +0200
+++ b/zshrc.d/30-functions.zrc	Wed May 08 15:18:39 2019 +0200
@@ -44,8 +44,8 @@
 function mkcd() {
     [[ -z $1 ]] && printf 'usage: mkcd NEW-DIRECTORY\n' && return 1
     [[ -d $1 ]] && printf 'mkcd: Directory %s already exists; cd-ing\n' $1
-    command mkdir -p -- $1
-    builtin cd -- $1
+    command mkdir -p -- "$1"
+    builtin cd -- "$1"
 }
 
 # genpass()