summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dotfiles-darwin/zsh/rc6
-rw-r--r--zsh/env4
2 files changed, 9 insertions, 1 deletions
diff --git a/dotfiles-darwin/zsh/rc b/dotfiles-darwin/zsh/rc
index 12e295a..faa0fef 100644
--- a/dotfiles-darwin/zsh/rc
+++ b/dotfiles-darwin/zsh/rc
@@ -7,7 +7,11 @@ alias ls='ls -G'
alias pbclear='pbcopy </dev/null'
alias rsync='rsync --exclude=.DS_Store'
-if (( ${+commands[gls]} )); then
+if command_exists container; then
+ alias co=container
+fi
+
+if command_exists gls; then
alias lsh='gls -Shrs'
else
alias lsh='ls -Shlr | cut -f5- -w'
diff --git a/zsh/env b/zsh/env
index e1b1fbf..78fe964 100644
--- a/zsh/env
+++ b/zsh/env
@@ -1,5 +1,9 @@
# -*- mode: shell-script -*-
+command_exists() {
+ return $(( !(${+commands[$1]} == 1) ))
+}
+
dotfiles_root() {
echo ${${(%):-%x}:A:h:h}
}