From 21310fecc7f9ba60421352b6458fdbd19f2cff11 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Tue, 19 Jul 2022 01:08:37 +0200 Subject: [PATCH] environment: allow for local customizations using a hidden file To use this, create a file `.localenv.bashrc` in the project's root directory and put your customizations in there. --- .gitignore | 2 ++ README.md | 4 +++- setupenv.bashrc | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9755a08..53a58f3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ /dependencies/* !/dependencies/.placeholder +.localenv.bashrc + # ignore endianness check /.endianness /resources/check_endianness diff --git a/README.md b/README.md index e007fe8..4e4faa8 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,9 @@ point to `bin/lib`. - `git clone` this repository - if using bash: - `source` the file `setupenv.bashrc` from the project's base directory - to load the provided shell environment + to load the provided shell environment (local customizations to the + environment can be placed in a fiile `.localenv.bashrc` in the project's + root directory if necessary) - `setup_project` - if not using bash or not using the provided environment: - `cd` to the project's base directory diff --git a/setupenv.bashrc b/setupenv.bashrc index 62aef72..6b007ec 100644 --- a/setupenv.bashrc +++ b/setupenv.bashrc @@ -40,6 +40,10 @@ else export LD_LIBRARY_PATH="$PROJECT_BASE_DIR"/bin/lib:"$LD_LIBRARY_PATH" fi +if [ -f "$PROJECT_BASE_DIR/.localenv.bashrc" ]; then + source "$PROJECT_BASE_DIR/.localenv.bashrc" +fi + unset PROJECT_BASE_DIR echo "done."