25 lines
595 B
Bash
25 lines
595 B
Bash
#! /usr/bin/env bash
|
|
MAIN_FILE="$(realpath "${BASH_SOURCE[0]}")"
|
|
MAIN_ROOT="$(dirname "${MAIN_FILE}")"
|
|
|
|
function link_bashrc {
|
|
local file='/etc/bash.bashrc'
|
|
rm --force "${file}"
|
|
ln --symbolic "${MAIN_FILE}" "${file}"
|
|
}
|
|
|
|
# import modules
|
|
function main_import_modules {
|
|
local IFS=$'\n'
|
|
local modules=($(find "${MAIN_ROOT}" -type 'f' -name '*.sh'))
|
|
local module
|
|
for module in "${modules[@]}" ; do
|
|
if [ "${module}" != "${MAIN_FILE}" ] ; then
|
|
source "${module}"
|
|
fi
|
|
done
|
|
log_trace "${modules[@]}"
|
|
}
|
|
|
|
# import modules
|
|
main_import_modules
|