From 1f19877d31d12beef67b268369de2dd7267af5aa Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Fri, 30 Sep 2022 13:09:35 +0000 Subject: [PATCH] Update dotfiles/.profile, dotfiles/.bashrc --- dotfiles/.bashrc | 64 +++++++++++++++++++++++++++-------------------- dotfiles/.profile | 4 ++- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index 68985d84..38df21af 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -1,8 +1,12 @@ ### Fig -[[ -f "$HOME/.fig/shell/bashrc.pre.bash" ]] && . "$HOME/.fig/shell/bashrc.pre.bash" +if [ -f "$HOME/.fig/shell/bashrc.pre.bash" ]; then + . "$HOME/.fig/shell/bashrc.pre.bash" +fi ### ~/.profile -[[ -f "$HOME/.profile" ]] && . "$HOME/.profile" +if [ -f "$HOME/.profile" ]; then + . "$HOME/.profile" +fi COLOR_SCHEME=dark # dark/light @@ -80,49 +84,49 @@ if [ -f /etc/os-release ]; then if [ -d /Applications ] && [ -d /Library ] && [ -d /System ]; then # macOS OS_ICON= - elif [[ "$ID" == 'alpine' ]]; then + elif [ "$ID" == 'alpine' ]; then OS_ICON= - elif [[ "$ID" == 'archlinux' ]]; then + elif [ "$ID" == 'archlinux' ]; then OS_ICON= - elif [[ "$ID" == 'centos' ]]; then + elif [ "$ID" == 'centos' ]; then OS_ICON= - elif [[ "$ID" == 'coreos' ]]; then + elif [ "$ID" == 'coreos' ]; then OS_ICON= - elif [[ "$ID" == 'debian' ]]; then + elif [ "$ID" == 'debian' ]; then OS_ICON= - elif [[ "$ID" == 'deepin' ]]; then + elif [ "$ID" == 'deepin' ]; then OS_ICON= - elif [[ "$ID" == 'elementary' ]]; then + elif [ "$ID" == 'elementary' ]; then OS_ICON= - elif [[ "$ID" == 'endeavour' ]]; then + elif [ "$ID" == 'endeavour' ]; then OS_ICON= - elif [[ "$ID" == 'freebsd' ]]; then + elif [ "$ID" == 'freebsd' ]; then OS_ICON= - elif [[ "$ID" == 'gentoo' ]]; then + elif [ "$ID" == 'gentoo' ]; then OS_ICON= - elif [[ "$ID" == 'kali' ]]; then + elif [ "$ID" == 'kali' ]; then OS_ICON= - elif [[ "$ID" == 'linuxmint' ]]; then + elif [ "$ID" == 'linuxmint' ]; then OS_ICON= - elif [[ "$ID" == 'manjaro' ]]; then + elif [ "$ID" == 'manjaro' ]; then OS_ICON= - elif [[ "$ID" == 'nixos' ]]; then + elif [ "$ID" == 'nixos' ]; then OS_ICON= - elif [[ "$ID" == 'openbsd' ]]; then + elif [ "$ID" == 'openbsd' ]; then OS_ICON= - elif [[ "$ID" == 'opensuse' ]]; then + elif [ "$ID" == 'opensuse' ]; then OS_ICON= - elif [[ "$ID" == 'parrot' ]]; then + elif [ "$ID" == 'parrot' ]; then OS_ICON= - elif [[ "$ID" == 'pop_os' ]]; then + elif [ "$ID" == 'pop_os' ]; then OS_ICON= - elif [[ "$ID" == 'raspberry_pi' ]]; then + elif [ "$ID" == 'raspberry_pi' ]; then OS_ICON= - elif [[ "$ID" == 'redhat' ]]; then + elif [ "$ID" == 'redhat' ]; then OS_ICON= - elif [[ "$ID" == 'fedora' ]]; then + elif [ "$ID" == 'fedora' ]; then OS_ICON= - elif [[ "$ID" == 'ubuntu' ]]; then + elif [ "$ID" == 'ubuntu' ]; then OS_ICON= else OS_ICON= @@ -230,12 +234,18 @@ export MCFLY_KEY_SCHEME=vim ### Google Cloud SDK if command -v brew > /dev/null; then - [[ ! -f "$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc" ]] || source "$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc" - [[ ! -f "$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc" ]] || source "$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc" + if [ -f "$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc" ]; then + . "$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc" + fi + if [ -f "$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc" ]; then + . "$(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc" + fi fi ### zoxide command -v zoxide > /dev/null && eval "$(zoxide init bash)" ### Fig -[[ -f "$HOME/.fig/shell/bashrc.post.bash" ]] && . "$HOME/.fig/shell/bashrc.post.bash" +if [ -f "$HOME/.fig/shell/bashrc.post.bash" ]; then + . "$HOME/.fig/shell/bashrc.post.bash" +fi diff --git a/dotfiles/.profile b/dotfiles/.profile index c7668ffe..726944fa 100644 --- a/dotfiles/.profile +++ b/dotfiles/.profile @@ -301,7 +301,9 @@ export PATH="$VOLTA_HOME/bin:$PATH" ### SDKMan export SDKMAN_DIR="$HOME/.local/sdkman" -[[ -s "$HOME/.local/sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.local/sdkman/bin/sdkman-init.sh" +if [ -s "$HOME/.local/sdkman/bin/sdkman-init.sh" ]; then + . "$HOME/.local/sdkman/bin/sdkman-init.sh" +fi # Running this will update GPG to point to the current YubiKey alias yubikey-gpg-stub='gpg-connect-agent "scd serialno" "learn --force" /bye'