Fix to get source files working with zsh

This commit is contained in:
Germain Haugou 2020-03-05 14:18:42 +01:00
parent e58af071ba
commit ffefb9d339
4 changed files with 32 additions and 3 deletions

View file

@ -1,6 +1,14 @@
#!/bin/bash -e
if [ -n "${ZSH_VERSION:-}" ]; then
DIR="$(readlink -f -- "${(%):-%x}")"
DIRNAME="$(dirname $DIR)"
scriptDir="$(dirname $DIRNAME)"
else
scriptDir="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
fi
export PULPRT_HOME=$scriptDir
export PULP_SDK_HOME=$PULPRT_HOME

View file

@ -3,6 +3,13 @@
export PULPRT_TARGET=marsellus
export PULPRUN_TARGET=marsellus
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ -n "${ZSH_VERSION:-}" ]; then
DIR="$(readlink -f -- "${(%):-%x}")"
scriptDir="$(dirname $DIR)"
else
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
fi
source $scriptDir/common.sh

View file

@ -3,6 +3,13 @@
export PULPRT_TARGET=pulp
export PULPRUN_TARGET=pulp
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ -n "${ZSH_VERSION:-}" ]; then
DIR="$(readlink -f -- "${(%):-%x}")"
scriptDir="$(dirname $DIR)"
else
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
fi
source $scriptDir/common.sh

View file

@ -3,6 +3,13 @@
export PULPRT_TARGET=pulpissimo
export PULPRUN_TARGET=pulpissimo
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ -n "${ZSH_VERSION:-}" ]; then
DIR="$(readlink -f -- "${(%):-%x}")"
scriptDir="$(dirname $DIR)"
else
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
fi
source $scriptDir/common.sh