From 17b4288519501dc67743a99fb5563b3221fe838c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Wed, 21 Aug 2019 17:06:22 +0200 Subject: [PATCH] env.sh: new functions - "nimble" and "add_submodule" --- scripts/env.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/env.sh b/scripts/env.sh index ec65c38..c6f17e6 100755 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -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 +"$@"