From 30109fe78e93bf2f88ebe866577bd957af35c98b Mon Sep 17 00:00:00 2001 From: Shaun Taheri Date: Thu, 22 Jun 2017 14:05:48 +0200 Subject: Fix script directory in zsh --- scripts/envsetup.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index 5adf319..7314111 100755 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh @@ -1,7 +1,6 @@ -#!/bin/sh +#!/bin/bash SCRIPT="envsetup.sh" - MACHINE=$1 if [ "$#" -lt 1 ]; then @@ -32,8 +31,12 @@ if [ $SOURCED -ne 1 ]; then exit -1 fi -SCRIPTDIR=$(cd $(dirname $BASH_SOURCE) && pwd -P) -METADIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) +if [ -n "$ZSH_VERSION" ]; then + SCRIPTDIR=$(cd $(dirname $0) && pwd -P) +else + SCRIPTDIR=$(cd $(dirname $BASH_SOURCE) && pwd -P) +fi +METADIR="${SCRIPTDIR}/../.." if [ -e ${BUILDDIR}/conf/local.conf ]; then source $METADIR/poky/oe-init-build-env ${BUILDDIR} -- cgit v1.2.3-54-g00ecf