generated from timoschneider/yocto-template
made scripts more robust
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n "$BASH_SOURCE" ]; then
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
elif [ -n "$ZSH_NAME" ]; then
|
||||
SCRIPT_DIR="$(cd "$(dirname "${(%):-%N}")" && pwd)"
|
||||
else
|
||||
echo "This script must be run with bash or zsh!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ---- Configuration -------------------------------------------------
|
||||
YOCTO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
YOCTO_ROOT="$(cd $SCRIPT_DIR/.. && pwd)"
|
||||
BUILD_DIR="${1:-build}"
|
||||
|
||||
CACHE_BASE="${YOCTO_ROOT}/.cache/yocto"
|
||||
|
||||
Reference in New Issue
Block a user