env.sh: new functions - "nimble" and "add_submodule"

This commit is contained in:
Ștefan Talpalaru 2019-08-21 17:06:22 +02:00
parent ab5566603f
commit 17b4288519
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
1 changed files with 16 additions and 3 deletions

View File

@ -11,8 +11,8 @@
## get native Windows paths on Mingw
#uname | grep -qi mingw && PWD_CMD="pwd -W"
REL_PATH="$(dirname $0)"
ABS_PATH="$(cd ${REL_PATH}; pwd)"
export REL_PATH="$(dirname $0)"
export ABS_PATH="$(cd ${REL_PATH}; pwd)"
# do we still need this?
#ABS_PATH_NATIVE="$(cd ${REL_PATH}; ${PWD_CMD})"
@ -35,5 +35,18 @@ export BUILD_OUTPUTS_DIR="${ABS_PATH}/../../../build"
# change the prompt in shells that source this file
export PS1="${PS1%\\\$ } [Nimbus env]\\$ "
exec "$@"
# functions, instead of aliases, to avoid typing long paths (aliases don't seem
# to be expanded by default for command line arguments)
nimble() {
"${ABS_PATH}/nimble.sh" "$@"
}
export -f nimble
add_submodule() {
"${ABS_PATH}/add_submodule.sh" "$@"
}
export -f add_submodule
# can't use "exec" here if we're getting function names as params
"$@"