Add IBM i support
This commit is contained in:
parent
7fabc8bca4
commit
da6775db79
|
@ -5,7 +5,7 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||||
# Enable ls colors
|
# Enable ls colors
|
||||||
if [ "$DISABLE_LS_COLORS" != "true" ]
|
if [ "$DISABLE_LS_COLORS" != "true" ]
|
||||||
then
|
then
|
||||||
# Find the option for using colors in ls, depending on the version: Linux or BSD
|
# Find the option for using colors in ls, depending on the version: Linux, BSD or IBM i
|
||||||
if [[ "$(uname -s)" == "NetBSD" ]]; then
|
if [[ "$(uname -s)" == "NetBSD" ]]; then
|
||||||
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
|
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
|
||||||
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
|
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
|
||||||
|
@ -17,6 +17,8 @@ then
|
||||||
# coreutils, so prefer it to "gls".
|
# coreutils, so prefer it to "gls".
|
||||||
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
|
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
|
||||||
colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
|
colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
|
||||||
|
elif [[ "$(uname -s)" == "OS400" ]]; then
|
||||||
|
# On IBM i ls doesn't support colors
|
||||||
else
|
else
|
||||||
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
|
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -24,12 +24,10 @@ main() {
|
||||||
# which may fail on systems lacking tput or terminfo
|
# which may fail on systems lacking tput or terminfo
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
|
if ! type zsh >/dev/null 2>&1; then
|
||||||
if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then
|
|
||||||
printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
|
printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
unset CHECK_ZSH_INSTALLED
|
|
||||||
|
|
||||||
if [ ! -n "$ZSH" ]; then
|
if [ ! -n "$ZSH" ]; then
|
||||||
ZSH=~/.oh-my-zsh
|
ZSH=~/.oh-my-zsh
|
||||||
|
@ -62,10 +60,18 @@ main() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
|
env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
|
||||||
printf "Error: git clone of oh-my-zsh repo failed\n"
|
printf "Error: git clone of oh-my-zsh repo failed (https)\n"
|
||||||
exit 1
|
GIT_CLONE_ERROR=1
|
||||||
}
|
}
|
||||||
|
# Support for git compiled without SSL
|
||||||
|
if [ $GIT_CLONE_ERROR -ge 1 ]; then
|
||||||
|
printf "Retry with ssh\n"
|
||||||
|
env git clone --depth=1 git@github.com:robbyrussell/oh-my-zsh.git $ZSH || {
|
||||||
|
printf "Error: git clone of oh-my-zsh repo failed (ssh)\n"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
unset GIT_CLONE_ERROR
|
||||||
|
|
||||||
printf "${BLUE}Looking for an existing zsh config...${NORMAL}\n"
|
printf "${BLUE}Looking for an existing zsh config...${NORMAL}\n"
|
||||||
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
|
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user