mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-23 21:56:33 +00:00
feat(scripts): x-load-configs is now a script
This commit is contained in:
22
local/bin/x-load-configs
Executable file
22
local/bin/x-load-configs
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Load our configuration files
|
||||||
|
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
|
||||||
|
|
||||||
|
: "${DOTFILES:=$HOME/.dotfiles}"
|
||||||
|
|
||||||
|
# Load the shell dotfiles, and then some:
|
||||||
|
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||||
|
HOST="$(hostname -s)"
|
||||||
|
# global (exports|alias|functions) file for all hosts
|
||||||
|
# shellcheck source=../config/exports
|
||||||
|
[ -r "$file" ] && source "$file"
|
||||||
|
# global secret file, git ignored
|
||||||
|
# shellcheck source=../config/exports-secret
|
||||||
|
[ -r "$file-secret" ] && source "$file-secret"
|
||||||
|
# host specific (exports|alias|functions) file
|
||||||
|
# shellcheck source=../config/exports
|
||||||
|
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
||||||
|
# host specific (exports|alias|functions) file, git ignored
|
||||||
|
# shellcheck source=../config/exports
|
||||||
|
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
||||||
|
done
|
||||||
@@ -8,27 +8,6 @@
|
|||||||
|
|
||||||
source "$DOTFILES/local/bin/msgr"
|
source "$DOTFILES/local/bin/msgr"
|
||||||
|
|
||||||
# Run x-load-configs in your terminal to reload the files.
|
|
||||||
function x-load-configs()
|
|
||||||
{
|
|
||||||
# Load the shell dotfiles, and then some:
|
|
||||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
|
||||||
HOST="$(hostname -s)"
|
|
||||||
# global (exports|alias|functions) file for all hosts
|
|
||||||
# shellcheck source=../config/exports
|
|
||||||
[ -r "$file" ] && source "$file"
|
|
||||||
# global secret file, git ignored
|
|
||||||
# shellcheck source=../config/exports-secret
|
|
||||||
[ -r "$file-secret" ] && source "$file-secret"
|
|
||||||
# host specific (exports|alias|functions) file
|
|
||||||
# shellcheck source=../config/exports
|
|
||||||
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
|
||||||
# host specific (exports|alias|functions) file, git ignored
|
|
||||||
# shellcheck source=../config/exports
|
|
||||||
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# -- Menu builder -- #
|
# -- Menu builder -- #
|
||||||
function menu_section()
|
function menu_section()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user