Mercurial > public > ssdt-docker
diff init.sh @ 143:c029be781d13
DEP-12: handle symlinks in home discovery
author | smith@nwoca.org |
---|---|
date | Wed, 05 Jul 2017 22:12:06 +0100 |
parents | 8f45c43ea7a4 |
children | 249ec634da33 |
line wrap: on
line diff
--- a/init.sh Fri Jun 16 17:14:16 2017 +0100 +++ b/init.sh Wed Jul 05 22:12:06 2017 +0100 @@ -1,6 +1,14 @@ #!/bin/bash -source "$( dirname "${BASH_SOURCE[0]}")/scripts/.functions.sh" +getSsdtHomeDir() { + SOURCE="${BASH_SOURCE[0]}" + while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done + echo $( cd $( dirname $SOURCE) && pwd ) +} + +echo ${BASH_SOURCE[*]} +export SSDT_HOME=$(getSsdtHomeDir) +export SSDT_SCRIPTS=${SSDT_HOME}/scripts +echo "ssdt_home $SSDT_HOME ($SSDT_SCRIPTS)" +source "${SSDT_SCRIPTS}/.functions.sh" alias utils='docker run -it -v ${PWD}:/tmp -v $SSDT_HOME:/ssdt --rm docker.ssdt.io/ssdt-utils' -alias send2ssdt='/ssdt/scripts/send.sh' - -export PATH=$PATH:$SSDT_HOME/scripts +alias send2ssdt='${SSDT_SCRIPTS}/send.sh'