diff options
author | Tyler Davis <tyler@gluecode.net> | 2024-05-16 01:44:34 +0000 |
---|---|---|
committer | Tyler Davis <tyler@gluecode.net> | 2024-05-16 01:44:34 +0000 |
commit | ea855bf657ba5c540e8c322714d432697bf09343 (patch) | |
tree | 4bf0cab871bf011c2a2f2a359506a3dd45e7d4f1 | |
parent | a248a002fd084b5c38e738811f242509fd661b5c (diff) | |
download | dotfiles-ea855bf657ba5c540e8c322714d432697bf09343.tar.gz dotfiles-ea855bf657ba5c540e8c322714d432697bf09343.zip |
sh: adapt to BSD
-rw-r--r-- | .bashrc | 2 | ||||
-rwxr-xr-x | .local/bin/allupdate | 5 | ||||
-rwxr-xr-x | .local/bin/confgit.sh | 22 | ||||
-rw-r--r-- | .profile | 60 |
4 files changed, 25 insertions, 64 deletions
@@ -13,5 +13,3 @@ if [ -f "$HOME/.gcloud/google-cloud-sdk/path.bash.inc" ]; then . "$HOME/.gcloud/ # The next line enables shell command completion for gcloud. if [ -f "$HOME/.gcloud/google-cloud-sdk/completion.bash.inc" ]; then . "$HOME/.gcloud/google-cloud-sdk/completion.bash.inc"; fi -#== Prompt Override == -export PS1="\W$ " diff --git a/.local/bin/allupdate b/.local/bin/allupdate index f439adc..cc4357a 100755 --- a/.local/bin/allupdate +++ b/.local/bin/allupdate @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh $HOME/.local/bin/confgit.sh @@ -27,8 +27,9 @@ Darwin) Linux) # Store APK list to a file apk list -I | cut -d ' ' -f 1 | rev | cut -d '-' -f 3- | rev | sort -u >~/.local/share/apklist - ;; +BSD) + ;; esac if [ "$(command -v fetchgit)" ] && [ -d $HOME/.code ]; then diff --git a/.local/bin/confgit.sh b/.local/bin/confgit.sh index f146da6..28046ca 100755 --- a/.local/bin/confgit.sh +++ b/.local/bin/confgit.sh @@ -125,24 +125,12 @@ fi # Git configs applied to folder groups if [ "$(command -v fd)" ]; then - if [ -d $HOME/.code/hpe ]; then - fd -H -t d -E mod -E vendor '.git$' $HOME/.code/hpe -x bash -c "cd {//}; git config user.email tdavis@hpe.com; git config http.cookiefile $HOME/.local/share/git/cookies-work;" - fi if [ -d $HOME/.code/gluecode ]; then - fd -H -t d -E mod -E vendor '.git$' $HOME/.code/gluecode -x bash -c "cd {//}; git config user.email tyler@gluecode.com;" - fi - if [ -d $HOME/.code/phoenix ]; then - fd -H -t d -E mod -E vendor '.git$' $HOME/.code/phoenix -x bash -c "cd {//}; git config user.email tyler@gluecode.com;" + find $HOME/.code/gluecode -name ".git" -type d -exec sh -c "cd {}; git config user.email tyler@gluecode.com;" \; fi else - if [ -d $HOME/.code/hpe ]; then - find $HOME/.code/hpe -name ".git" -exec bash -c "cd {}; git config user.email tdavis@hpe.com; git config http.cookiefile $HOME/.local/share/git/cookies-work;" \; - fi if [ -d $HOME/.code/gluecode ]; then - find $HOME/.code/gluecode -name ".git" -exec bash -c "cd {}; git config user.email tyler@gluecode.net;" \; - fi - if [ -d $HOME/.code/phoenix ]; then - find $HOME/.code/phoenix -name ".git" -exec bash -c "cd {}; git config user.email tyler@gluecode.net;" \; + find $HOME/.code/gluecode -name ".git" -exec sh -c "cd {}; git config user.email tyler@gluecode.net;" \; fi fi @@ -169,6 +157,10 @@ Linux) git config --global sendemail.smtpserver /usr/bin/msmtp ;; FreeBSD) - # commands for FreeBSD go here + git config --global credential.helper "store --file=/home/tydavis/.config/gitcreds" + # Email configuration for `git send-email` command - default Gluecode + git config --global sendemail.annotate yes # Review and edit each patch + git config --global sendemail.confirm auto + git config --global sendemail.smtpserver /usr/bin/msmtp ;; esac @@ -1,9 +1,8 @@ # Moving aliases and other setup to non-shell-specific # file ~/.profile -# === OSX === -if [ "$(uname -s)" = "Darwin" ]; then - # Make bash more posix compliant +case $(uname) in +Darwin) if [ $SHELL = "/bin/bash" ] || [ $SHELL = "/opt/homebrew/bin/bash" ] || [ $SHELL = "/opt/local/bin/bash" ] ; then set -o posix # OSX-specific bash warning @@ -44,12 +43,19 @@ if [ "$(uname -s)" = "Darwin" ]; then alias unlock='security unlock-keychain ~/Library/Keychains/login.keychain' alias ls='/bin/ls -F -h -A -D "%F %H:%M:%S"' alias ll='/bin/ls -F -h -A -D "%F %H:%M:%S" -l' -else - # Linux alias is likely busybox or gnu, which doesn't have the -D argument option - alias ls='/bin/ls --color=never -F -h -A ' - alias ll='/bin/ls --color=never -F -h -A -l' -fi -# === END OSX === + ;; +Linux) + alias ls="/bin/ls --color=never -F -h -A " + alias ll="/bin/ls --color=never -F -h -A -l" + ;; +*BSD) + alias ls="/bin/ls -F -h -A " + alias ll="/bin/ls -F -h -A -l" + set -o emacs + set -o tabcomplete + export PATH=$PATH:$HOME/.local/bin + ;; +esac # Go setup if [ -d "$HOME/.golang" ]; then @@ -75,10 +81,6 @@ fi if [ "$(command -v code)" ] && [ "$(env | grep VSCODE)" ]; then export EDITOR="code" export VISUAL="code" -elif [ -d "$HOME/.config/doom" ] && [ "$(command -v emacs)" ]; then - export EDITOR="emacs" - export VISUAL="emacs" - export PATH=$PATH:$HOME/.config/emacs/bin elif [ "$(command -v hx)" ]; then export EDITOR="hx" export VISUAL="hx" @@ -91,9 +93,7 @@ fi export LESS=FRX # Defaults - alias dua='du -h -d 1 | sort -h' - alias upcode="find ~/.code -name \".git\" -exec fetchgit {} \;" ## Zstd always uses all cores @@ -110,34 +110,7 @@ if [ -d "$HOME/.cargo/bin" ]; then export PATH=$HOME/.cargo/bin:$PATH fi -if [ "$(command -v bat)" ]; then - alias cat='bat -pp' - export BAT_THEME="ansi" -fi - -if [ "$(command -v ncdu)" ]; then - alias ncdu="ncdu --color=off" -fi - -# 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 - - -# Presrving these for future use -#alias psc='ps xawf -eo pid,user,cgroup,args' -#alias gdb='gdb -tui' - alias gc_all="find ~/.code -name \".git\" | xargs -I {} -n 1 bash -c \"cd {}; echo {}; git gc --aggressive;\" " - -#if [ "$TERM" = "tmux-256color" ]; then export TERM=xterm-256color; fi # == END TOOLS == ## == DOTFILES == @@ -158,6 +131,3 @@ export HISTFILE=~/.history export HISTSIZE=10000 export PS1='\$ ' -if [ ! $(echo $SHELL|grep -q "bash") ]; then - if [ -f "$HOME/.bashrc" ]; then . $HOME/.bashrc; fi -fi |