fix: Linux/Ubuntu compatibility for shell configs and dotfiles manager
00_env.sh:
- yaml2json: use python3 (python3 first, python fallback) — Ubuntu 20+ has no 'python'
- pyenv init: moved out of Darwin-only block; now runs everywhere if pyenv installed
- xterm ls alias: split by OS — Linux gets 'ls --color=auto', macOS gets 'ls -G'
10_aliases.sh:
- psg: guard with 'command -v pstree' (not installed by default on Ubuntu)
- ps-m: Linux-only (--sort flag is GNU ps, not available on macOS)
- gitresetpw: OS-conditional — osxkeychain on Darwin, store on Linux
dotfiles_manager.sh:
- Replace both hardcoded 'brew install gnupg' die messages with _require_gpg()
helper that gives apt-get hint on Linux and brew hint on macOS
This commit is contained in:
@@ -17,8 +17,10 @@ alias sl='screen -list'
|
||||
alias sr='screen -r'
|
||||
|
||||
# Process inspection
|
||||
alias psg='pstree | grep'
|
||||
alias ps-m='ps aux --sort -rss'
|
||||
# pstree may not be installed on all systems
|
||||
command -v pstree >/dev/null 2>&1 && alias psg='pstree | grep'
|
||||
# --sort is a GNU ps flag (Linux only)
|
||||
[[ "$(uname -s)" == "Linux" ]] && alias ps-m='ps aux --sort -rss'
|
||||
|
||||
# Docker — short forms
|
||||
alias d='docker'
|
||||
@@ -29,5 +31,10 @@ alias db='docker build'
|
||||
|
||||
# Git helpers
|
||||
alias giturl='git config --get remote.origin.url'
|
||||
alias gitresetpw='git config --global credential.helper osxkeychain'
|
||||
# Git credential helper is OS-specific
|
||||
if [[ "$(uname -s)" == "Darwin" ]]; then
|
||||
alias gitresetpw='git config --global credential.helper osxkeychain'
|
||||
else
|
||||
alias gitresetpw='git config --global credential.helper store'
|
||||
fi
|
||||
alias git-clean='git-prune-branches'
|
||||
|
||||
Reference in New Issue
Block a user