mkcd: Return from function on failure instead of calling false
This commit is contained in:
parent
d6969d8505
commit
c8408f0dd7
@ -2,7 +2,7 @@
|
|||||||
# Make a directory, then change into it
|
# Make a directory, then change into it
|
||||||
mkcd() {
|
mkcd() {
|
||||||
[[ ! -d "${1}" ]] && mkdir --parents -- "${1}"
|
[[ ! -d "${1}" ]] && mkdir --parents -- "${1}"
|
||||||
cd "${1}" || false
|
cd "${1}" || return
|
||||||
}
|
}
|
||||||
|
|
||||||
autoload -Uz mkcd
|
autoload -Uz mkcd
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# Make a directory, then change into it
|
# Make a directory, then change into it
|
||||||
mkcd() {
|
mkcd() {
|
||||||
[[ ! -d "${1}" ]] && gmkdir --parents -- "${1}"
|
[[ ! -d "${1}" ]] && gmkdir --parents -- "${1}"
|
||||||
cd "${1}" || false
|
cd "${1}" || return
|
||||||
}
|
}
|
||||||
|
|
||||||
autoload -Uz mkcd
|
autoload -Uz mkcd
|
||||||
|
Loading…
x
Reference in New Issue
Block a user