mirror of
https://github.com/status-im/nimbus-build-system-desktop.git
synced 2025-02-13 14:16:46 +00:00
Better compatibility with direnv
Scripts sourcing a project env.sh file (e.g. direnv's .envrc) can specify the `NBS_ONLY_LOAD_ENV_VARS` env variable to avoid any attempts from NBS to execute a target script. Previously, the script was trying to detect only sourcing from an interactive shell.
This commit is contained in:
parent
b1d380e07e
commit
dc535cd462
@ -68,12 +68,14 @@ $EXPORT_FUNC add_submodule
|
||||
|
||||
export NIMBUS_BUILD_SYSTEM=yes
|
||||
|
||||
if [[ $# == 1 && $1 == "bash" ]]; then
|
||||
# the only way to change PS1 in a child shell, apparently
|
||||
# (we're not getting the original PS1 value in here, so set a complete and nice prompt)
|
||||
export PS1="[Nimbus env] \[\033[0;31m\]\l \[\033[1;33m\]\d \[\033[1;36m\]\t \[\033[0;32m\]|\w|\[\033[0m\]\n\u\$ "
|
||||
exec "$1" --login --noprofile
|
||||
else
|
||||
# can't use "exec" here if we're getting function names as params
|
||||
"$@"
|
||||
if [[ ! -n "$NBS_ONLY_LOAD_ENV_VARS" ]]; then
|
||||
if [[ $# == 1 && $1 == "bash" ]]; then
|
||||
# the only way to change PS1 in a child shell, apparently
|
||||
# (we're not getting the original PS1 value in here, so set a complete and nice prompt)
|
||||
export PS1="[Nimbus env] \[\033[0;31m\]\l \[\033[1;33m\]\d \[\033[1;36m\]\t \[\033[0;32m\]|\w|\[\033[0m\]\n\u\$ "
|
||||
exec "$1" --login --noprofile
|
||||
else
|
||||
# can't use "exec" here if we're getting function names as params
|
||||
"$@"
|
||||
fi
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user