-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrc
More file actions
36 lines (30 loc) · 1.22 KB
/
rc
File metadata and controls
36 lines (30 loc) · 1.22 KB
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
# -*- shell-script -*-
# Non-login runtime configuration script for BASh.
# If not running interactively, don't do anything:
[ -z "$PS1" ] && return
# Source the configuration-bootstrap script if necessary. We expect it to be
# in lib/bootstrap relative to the current file.
if test -z "${BASHCONF_CONFIG_DIR}"; then
if test "${BASH_VERSINFO[0]}" -ge 3; then
BASHCONF_CONFIG_DIR="$(realpath "$BASH_SOURCE")"
while test -n "${BASHCONF_CONFIG_DIR}" -a ! -f "${BASHCONF_CONFIG_DIR}/lib/bootstrap"; do
BASHCONF_CONFIG_DIR="${BASHCONF_CONFIG_DIR%/*}"
done
else
# Prior to v3.0, Bash didn't supply the BASH_SOURCE variable; the best way
# to determine the correct location is to hardcode it... :|
BASHCONF_CONFIG_DIR="${XDG_CONFIG_HOME:-${HOME}/.config}/bash"
fi
fi
. "${BASHCONF_CONFIG_DIR}/lib/bootstrap"
if test -z "${BASHCONF_HAVE_CONFIG}"; then
echo '*** ERROR: Failed to load Bash configuration variables.' \
> /dev/stderr
else
bashconf-source-parts "${BASHCONF_CONFIG_DIR}/rc.d"
# `profile` calls (sources) `rc`, so only run bashconf-cleanup if we're not
# in `profile`.
if test -z "${BASHCONF_IN_PROFILE}"; then
bashconf-cleanup
fi
fi