From dd1ee57228b1bfa5d01982bc2d8149eccd7a5a44 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 12 May 2023 23:38:42 +0200 Subject: [PATCH] link bashrc --- bash/main.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bash/main.sh b/bash/main.sh index 71452c3..8996b7e 100644 --- a/bash/main.sh +++ b/bash/main.sh @@ -1,11 +1,17 @@ #! /usr/bin/env bash -FILE="$(realpath "${BASH_SOURCE[0]}")" -ROOT="$(dirname "${FILE}")" +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}" +} function main { local module - for module in "${ROOT}"/*.sh ; do - if [ "${module}" != "${FILE}" ] ; then + for module in "${MAIN_ROOT}"/*.sh ; do + if [ "${module}" != "${MAIN_FILE}" ] ; then source "${module}" fi done