From f48f2321192747bdb9876cc42e4abfa8c88d35a4 Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Wed, 6 Apr 2022 17:48:50 -0700 Subject: [PATCH] Update settings for linux --- .../bash/bashrc.d/hellotech-bash-completion.sh | 6 ++++-- hellotech/.config/bash/bashrc.d/hellotech.sh | 4 +++- hellotech/.config/bash/env.d/hellotech-config.env | 2 +- hellotech/.config/profile/env.d/hellotech.env | 1 - hellotech/.config/profile/profile.d/hellotech.sh | 14 ++++++++++++++ 5 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 hellotech/.config/profile/profile.d/hellotech.sh diff --git a/hellotech/.config/bash/bashrc.d/hellotech-bash-completion.sh b/hellotech/.config/bash/bashrc.d/hellotech-bash-completion.sh index 57a0170..b1c31d1 100644 --- a/hellotech/.config/bash/bashrc.d/hellotech-bash-completion.sh +++ b/hellotech/.config/bash/bashrc.d/hellotech-bash-completion.sh @@ -1,7 +1,9 @@ # vi: ft=bash -if [ -f "$(brew --prefix)/share/bash-completion/bash_completion" ]; then - . "$(brew --prefix)/share/bash-completion/bash_completion" +if command -v brew &> /dev/null; then + if [ -f "$(brew --prefix)/share/bash-completion/bash_completion" ]; then + . "$(brew --prefix)/share/bash-completion/bash_completion" + fi fi if command -v kubectl > /dev/null 2>&1; then diff --git a/hellotech/.config/bash/bashrc.d/hellotech.sh b/hellotech/.config/bash/bashrc.d/hellotech.sh index 68d5bd4..64eab4b 100644 --- a/hellotech/.config/bash/bashrc.d/hellotech.sh +++ b/hellotech/.config/bash/bashrc.d/hellotech.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash -eval "$(rbenv init -)" +if command -v rbenv &> /dev/null; then + eval "$(rbenv init -)" +fi alias orb="cd ~/code/circleci-ci-orb" alias core="cd ~/code/core" diff --git a/hellotech/.config/bash/env.d/hellotech-config.env b/hellotech/.config/bash/env.d/hellotech-config.env index 9a8ccf9..b81b73c 100644 --- a/hellotech/.config/bash/env.d/hellotech-config.env +++ b/hellotech/.config/bash/env.d/hellotech-config.env @@ -1,2 +1,2 @@ # shellcheck disable=SC2034 -PATH="${PATH}:${HOME}/.rbenv/shims:/usr/local/opt/mysql-client/bin:${HOME}/google-cloud-sdk/bin" + diff --git a/hellotech/.config/profile/env.d/hellotech.env b/hellotech/.config/profile/env.d/hellotech.env index 868bf89..6b11b94 100644 --- a/hellotech/.config/profile/env.d/hellotech.env +++ b/hellotech/.config/profile/env.d/hellotech.env @@ -1,5 +1,4 @@ # shellcheck disable=SC2034 GOPRIVATE=github.com/HelloTech GO_TEST=gotest -PATH="${PATH}:${HOME}/.rbenv/shims:/usr/local/opt/mysql-client/bin:${HOME}/google-cloud-sdk/bin" PULUMI_SKIP_UPDATE_CHECK=true diff --git a/hellotech/.config/profile/profile.d/hellotech.sh b/hellotech/.config/profile/profile.d/hellotech.sh new file mode 100644 index 0000000..3476736 --- /dev/null +++ b/hellotech/.config/profile/profile.d/hellotech.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +_add_path () { + if [ ! -d "$1" ]; then + return + fi + PATH="${PATH}:$1" +} + +_add_path "${HOME}/.rbenv/shims" +_add_path "/usr/local/opt/mysql-client/bin" +_add_path "${HOME}/google-cloud-sdk/bin" + +unset _add_path