openbmc-env: fix shellcheck errors
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I0a12cd34c3cff8381bfd6197c11eb91a4efcf0f4
diff --git a/openbmc-env b/openbmc-env
index 03e8628..1d06dcf 100644
--- a/openbmc-env
+++ b/openbmc-env
@@ -1,16 +1,18 @@
-if [ -n "$BASH_SOURCE" ]; then
- OBMCROOT="`dirname $BASH_SOURCE`"
+#!/bin/bash
+if [ -n "${BASH_SOURCE[0]}" ]; then
+ OBMCROOT="$(dirname "${BASH_SOURCE[0]}")"
elif [ -n "$ZSH_NAME" ]; then
- OBMCROOT="`dirname $0`"
+ OBMCROOT="$(dirname "$0")"
else
- OBMCROOT="`pwd`"
+ OBMCROOT="$(pwd)"
fi
-if [ -f $OBMCROOT/customrc ]; then
+if [ -f "$OBMCROOT/customrc" ]; then
echo "### Sourcing customrc ###"
- . $OBMCROOT/customrc
+ # shellcheck source=/dev/null
+ . "$OBMCROOT/customrc"
fi
echo "### Initializing OE build env ###"
-. $OBMCROOT/oe-init-build-env
-
+# shellcheck source=oe-init-build-env
+. "$OBMCROOT/oe-init-build-env"