diff options
author | Tyler Davis <tyler@gluecode.net> | 2023-09-11 11:19:26 -0700 |
---|---|---|
committer | Tyler Davis <tyler@gluecode.net> | 2023-09-11 11:19:26 -0700 |
commit | b952b4331cf478cb9b870c9a06c8237233a41485 (patch) | |
tree | 0cf88e6f24454549949bfb951b432edb8584f083 /.profile | |
parent | 5bbe41709bc7aacd6ad5989f8e376600253e3549 (diff) | |
download | dotfiles-b952b4331cf478cb9b870c9a06c8237233a41485.tar.gz dotfiles-b952b4331cf478cb9b870c9a06c8237233a41485.zip |
sh: move OSX test to top of file
Diffstat (limited to '.profile')
-rw-r--r-- | .profile | 108 |
1 files changed, 56 insertions, 52 deletions
@@ -1,6 +1,56 @@ # Moving aliases and other setup to non-shell-specific # file ~/.profile +# === OSX === +if [ "$(uname -s)" = "Darwin" ]; then + # Make bash more posix compliant + if [ $SHELL = "/bin/bash" ] || [ $SHELL = "/opt/homebrew/bin/bash" ] || [ $SHELL = "/opt/local/bin/bash" ] ; then + set -o posix + # OSX-specific bash warning + export BASH_SILENCE_DEPRECATION_WARNING=1 + fi + + # MacPorts setup + if [ -d '/opt/local' ]; then + export PATH="/opt/local/bin:/opt/local/sbin:$PATH" + export MANPATH=/opt/local/share/man:$MANPATH + fi + + # Brew (OSX) specifics + if [ -f '/opt/homebrew/bin/brew' ]; then + export HOMEBREW_PREFIX="/opt/homebrew" + export HOMEBREW_CELLAR="/opt/homebrew/Cellar" + export HOMEBREW_REPOSITORY="/opt/homebrew" + export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}" + export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:" + export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}" + if [ -f "/opt/homebrew/etc/bash_completion.d/git-completion.bash" ]; then + source /opt/homebrew/etc/bash_completion.d/git-completion.bash; + fi + fi + + if [ $(command -v python3) ]; then + export PATH=$(python3 -m site --user-base)/bin:$PATH + fi + + # Load config from filesystem + export AWS_SDK_LOAD_CONFIG=1 + + # Add Local bin + export PATH=$PATH:/Users/tydavis/.local/bin + + # Unlock Keychain cli + alias unlock='security unlock-keychain ~/Library/Keychains/login.keychain' + + #upcode alias for quickly updating code where gitrect cannot + if [ "$(command -v fd)" ]; then + alias upcode="fd -H -t d -E mod -E vendor '.git$' ~/.code -x fetchgit" + else + alias upcode="find ~/.code -name \".git\" |xargs -n1 fetchgit " + fi +fi +# === END OSX === + # Go setup if [ -d "$HOME/.golang" ]; then ### Just in case it's missing @@ -59,64 +109,18 @@ if [ "$(command -v btm)" ]; then alias btm="btm -m -l --mem_as_value " fi -# Lima / Podman -if [ "$(command -v nerdctl.lima)" ]; then - alias docker=nerdctl.lima + +# Must put these after OSX setup so brew is part of the $PATH +# Colima / Podman +if [ $(command -v colima) ]; then + alias docker='colima nerdctl --profile default -- ' + alias nerdctl='colima nerdctl --profile default -- ' elif [ "$(command -v podman)" ]; then alias docker=podman # User-hosted podman socket export DOCKER_HOST="unix:$XDG_RUNTIME_DIR/podman/podman.sock" fi -# === OSX === -if [ "$(uname -s)" = "Darwin" ]; then - # Make bash more posix compliant - if [ $SHELL = "/bin/bash" ] || [ $SHELL = "/opt/homebrew/bin/bash" ] || [ $SHELL = "/opt/local/bin/bash" ] ; then - set -o posix - # OSX-specific bash warning - export BASH_SILENCE_DEPRECATION_WARNING=1 - fi - - if [ -d '/opt/local' ]; then - export PATH="/opt/local/bin:/opt/local/sbin:$PATH" - export MANPATH=/opt/local/share/man:$MANPATH - fi - - # Brew (OSX) specifics - if [ -f '/opt/homebrew/bin/brew' ]; then - export HOMEBREW_PREFIX="/opt/homebrew" - export HOMEBREW_CELLAR="/opt/homebrew/Cellar" - export HOMEBREW_REPOSITORY="/opt/homebrew" - export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}" - export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:" - export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}" - if [ -f "/opt/homebrew/etc/bash_completion.d/git-completion.bash" ]; then - source /opt/homebrew/etc/bash_completion.d/git-completion.bash; - fi - fi - - if [ $(command -v python3) ]; then - export PATH=$(python3 -m site --user-base)/bin:$PATH - fi - - # Load config from filesystem - export AWS_SDK_LOAD_CONFIG=1 - - # Add Local bin - export PATH=$PATH:/Users/tydavis/.local/bin - - # Unlock Keychain cli - alias unlock='security unlock-keychain ~/Library/Keychains/login.keychain' - - #upcode alias for quickly updating code where gitrect cannot - if [ "$(command -v fd)" ]; then - alias upcode="fd -H -t d -E mod -E vendor '.git$' ~/.code -x fetchgit" - else - alias upcode="find ~/.code -name \".git\" |xargs -n1 fetchgit " - fi -fi -# === END OSX === - # Presrving these for future use #alias psc='ps xawf -eo pid,user,cgroup,args' #alias gdb='gdb -tui' |