mirror of
https://github.com/status-im/nimbus-build-system.git
synced 2025-02-16 14:27:02 +00:00
env.sh: $0 -> $BASH_SOURCE (to allow sourcing the file)
and set the prompt in `env.sh bash`
This commit is contained in:
parent
bf10b1b72e
commit
9397da232f
@ -11,7 +11,7 @@
|
||||
## get native Windows paths on Mingw
|
||||
#uname | grep -qi mingw && PWD_CMD="pwd -W"
|
||||
|
||||
export REL_PATH="$(dirname $0)"
|
||||
export REL_PATH="$(dirname $BASH_SOURCE)"
|
||||
export ABS_PATH="$(cd ${REL_PATH}; pwd)"
|
||||
# do we still need this?
|
||||
#ABS_PATH_NATIVE="$(cd ${REL_PATH}; ${PWD_CMD})"
|
||||
@ -47,6 +47,13 @@ add_submodule() {
|
||||
}
|
||||
export -f add_submodule
|
||||
|
||||
# can't use "exec" here if we're getting function names as params
|
||||
"$@"
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user