mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-02 16:43:47 +00:00
32 lines
1.0 KiB
Bash
Executable File
32 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Load our configuration files
|
|
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
|
|
|
|
DOTFILES="$HOME/.dotfiles"
|
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
|
|
|
CONFIG_PATH="$DOTFILES/config"
|
|
|
|
# Load the shell dotfiles, and then some:
|
|
function x-load-config-fn()
|
|
{
|
|
for FILE in $CONFIG_PATH/{exports,alias,functions}; do
|
|
FILENAME="$FILE"
|
|
HOST="$(hostname -s)"
|
|
# global (exports|alias|functions) FILENAME for all hosts
|
|
# shellcheck source=../config/exports
|
|
[ -r "$FILENAME" ] && source "$FILENAME"
|
|
# global secret FILENAME, git ignored
|
|
# shellcheck source=../config/exports-secret
|
|
[ -r "$FILENAME-secret" ] && source "$FILENAME-secret"
|
|
# host specific (exports|alias|functions) FILENAME
|
|
# shellcheck source=../config/exports
|
|
[ -r "$FILENAME-$HOST" ] && source "$FILENAME-$HOST"
|
|
# host specific (exports|alias|functions) FILENAME, git ignored
|
|
# shellcheck source=../config/exports
|
|
[ -r "$FILENAME-$HOST-secret" ] && source "$FILENAME-$HOST-secret"
|
|
done
|
|
}
|
|
|
|
x-load-config-fn
|