sh/bash/main.sh

21 lines
445 B
Bash
Raw Normal View History

2023-05-09 20:09:01 +00:00
#! /usr/bin/env bash
2023-05-12 21:38:42 +00:00
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}"
}
2023-05-09 20:09:01 +00:00
2023-05-14 11:59:46 +00:00
function main_import_modules {
2023-05-09 20:15:40 +00:00
local module
2023-05-12 21:38:42 +00:00
for module in "${MAIN_ROOT}"/*.sh ; do
if [ "${module}" != "${MAIN_FILE}" ] ; then
2023-05-09 20:15:40 +00:00
source "${module}"
fi
done
}
2023-05-09 20:09:01 +00:00
2023-05-14 11:59:46 +00:00
main_import_modules