summaryrefslogtreecommitdiff
path: root/misc/dotfiles/bashrc.j2
blob: d0a69a64dab572998d4412ebf410b30a38b8100a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Source system-wide settings of there are any.
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

# Enable colors for `ls` output, but not on macOS, see `CLICOLOR` comment.
alias ls="ls --color=auto"

# Enable colors for `grep` output.
alias grep="grep --color=auto"

# Enable colors for `diff` output.
alias diff='diff --color=auto'

{% if ansible_facts['os_family'] == "Darwin" %}
# Specific settings for macOS.
if [[ "$OSTYPE" == "darwin"* ]]; then

# Set `LC_CTYPE` compatible with Linux systems. macOS sets `LC_CTYPE` to
# `UTF-8`, when Terminal has 'Set locale environment variables on startup'
# checkbox ticked in settings. `UTF-8` doesn't seem like a valid value, so
# override it to more sensible one.
export LC_CTYPE=en_US.UTF-8

# Silence bash deprecation warning.
export BASH_SILENCE_DEPRECATION_WARNING=1

# Enable colors for `ls` output. `ls` in macOS is separate from `bash` and
# normal trick with alias doesn't work.
export CLICOLOR=1

# Get GitHub token from keychain to avoid homebrew rate limiting on GitHub
# side.
export HOMEBREW_GITHUB_API_TOKEN=`security \
    find-generic-password -s "Homebrew GitHub API Token" -w`

fi
{% endif %}