Skip to content

Commit 6430dd4

Browse files
committed
fix: improve shell config
1 parent 538e239 commit 6430dd4

File tree

6 files changed

+25
-23
lines changed

6 files changed

+25
-23
lines changed

shell/aliases.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
# Reload the shell (i.e. invoke as a login shell)
77
alias reload="exec $SHELL -l"
88

9+
function chshell {
10+
grep -q "${HOMEBREW_PREFIX:-}/bin/${1:-zsh}" "/etc/shells" \
11+
|| echo "${HOMEBREW_PREFIX:-}/bin/${1:-zsh}" >> /etc/shells
12+
chsh -s "${HOMEBREW_PREFIX:-}/bin/${1:-zsh}"
13+
}
14+
915
# Easier navigation: .., ..., ...., ....., ~ and -
1016
alias ..="cd .."
1117
alias ...="cd ../.."

shell/exports.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# shellcheck shell=bash disable=SC1090,SC1091
22
#
33
# EXPORTS
4-
#
54
# Defines exports/variables for bash scripting environment.
65

76
#-------------------------------------------------------------------------------

shell/ls_colors.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fi
1717
# Use GNU ls, if installed by Homebrew.
1818
# Always use color output for `ls`.
1919
if [[ -r "${HOMEBREW_PREFIX:-}/bin/gls" ]]; then
20-
alias ls="command ${HOMEBREW_PREFIX:-}/bin/gls ${colorflag}"
20+
alias ls="command ${HOMEBREW_PREFIX:-}/bin/gls --color=always --group-directories-first"
2121
else
2222
alias ls="command ls ${colorflag}"
2323
fi

shell/paths.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# shellcheck shell=bash
1+
# shellcheck shell=bash disable=SC1090,SC1091
22
#
33
# PATH / MANPATH exports
4-
#
54
# Defines the $PATH export/variable for shell environments.
65

76
type "find_files" &> /dev/null || . "$DOTFILES/functions/find_files"
@@ -32,19 +31,22 @@ export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
3231

3332
# LOAD DOTFILES PATHS:
3433
# for file in ~/.dotfiles/{git,system}/path.sh; do
35-
_find_files_array=($(find -H "$DOTFILES" -maxdepth 2 -perm -u+r -type f -name 'path.sh'))
36-
for _file_path in "${_find_files_array[@]}"; do
37-
. "$_file_path"
38-
done
39-
unset _file_path _find_files_array
34+
for _file in $(find_files "$DOTFILES" 'path.sh' 2); do . "$_file"; done; unset _file
4035

4136
# CUSTOM/USER PATHS
4237
# `~/.path` can be used to extend `$PATH`.
43-
# shellcheck disable=SC1090
4438
[[ -f "$HOME/.path" ]] && . "$HOME/.path"
4539

46-
# Ensure Homebrew path comes first
47-
export PATH="/opt/homebrew/bin:$PATH"
40+
#-------------------------------------------------------------------------------
41+
# HOMEBREW
42+
#-------------------------------------------------------------------------------
43+
44+
# Homebrew init.
45+
[[ -f "$DOTFILES/brew/init_install.sh" ]] && . "$DOTFILES/brew/init_install.sh" \
46+
&& _init_homebrew
47+
48+
# Homebrew path must come first to override system binaries.
49+
export PATH="${HOMEBREW_PREFIX:-/usr/local}/bin:$PATH"
4850

4951
#-------------------------------------------------------------------------------
5052
# HELP DOCS/MANUALS

system/aliases.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ alias dt="cd ~/Desktop"
1111
alias h="history"
1212
alias j="jobs"
1313

14-
# Get macOS Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
15-
alias update='(cd; sudo softwareupdate -i -a; brew update; brew upgrade; brew cleanup; npm cache clean -g -f; npm install -g npm@latest; npm update -g; npm cache clean -g -f; sudo gem update --system; sudo gem update)'
1614
alias brewupdate='brew update; brew upgrade; brew cleanup'
17-
alias macupdate='sudo softwareupdate -i -a'
1815
alias nodeupdate='(cd; npm cache clean -g -f; brew update node --without-npm; npm install -g npm@latest; npm update -g; npm cache clean -g -f)'
1916
alias rubyupdate='sudo gem update --system; sudo gem update'

user/aliases.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# shellcheck shell=bash
2-
#
3-
#
1+
# shellcheck shell=bash disable=SC2139
42

53
################################################################################
64
# Homebrew aliases
@@ -22,11 +20,11 @@ alias brew_update="brew update; brew upgrade; brew cleanup"
2220
# Docker Compose
2321
#-------------------------------------------------------------------------------
2422

25-
alias dockerc="docker-compose"
26-
alias dkrup="docker-compose stop < /dev/null 2> /dev/null; docker-compose up --build"
27-
alias dkrstop="docker-compose stop < /dev/null 2> /dev/null"
28-
alias dkroff="docker ps; docker-compose stop < /dev/null 2> /dev/null; docker rm -f \"$(docker ps -a -q < /dev/null 2> /dev/null)\" < /dev/null 2> /dev/null; docker ps -a"
29-
alias dkr0="docker images; docker-compose stop < /dev/null 2> /dev/null; docker rmi -f \"$(docker images -a -q < /dev/null 2> /dev/null)\" < /dev/null 2> /dev/null; docker images"
23+
alias dockerc="docker compose"
24+
alias dkrup="docker compose stop < /dev/null 2> /dev/null; docker compose up --build"
25+
alias dkrstop="docker compose stop < /dev/null 2> /dev/null"
26+
alias dkroff="docker ps; docker compose stop < /dev/null 2> /dev/null; docker rm -f \"$(docker ps -a -q < /dev/null 2> /dev/null)\" < /dev/null 2> /dev/null; docker ps -a"
27+
alias dkr0="docker images; docker compose stop < /dev/null 2> /dev/null; docker rmi -f \"$(docker images -a -q < /dev/null 2> /dev/null)\" < /dev/null 2> /dev/null; docker images"
3028

3129
################################################################################
3230
# Jekyll (and Bundler) aliases

0 commit comments

Comments
 (0)