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.
BodgeMaster-unfinished
BodgeMaster 2022-07-19 01:08:37 +02:00
parent 09e2030a55
commit 21310fecc7
3 changed files with 9 additions and 1 deletions

2
.gitignore vendored
View File

@ -4,6 +4,8 @@
/dependencies/*
!/dependencies/.placeholder
.localenv.bashrc
# ignore endianness check
/.endianness
/resources/check_endianness

View File

@ -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

View File

@ -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."