format-code: fix for 'git worktree' model

Some developers use `git worktree` to avoid having separate clones
of their source repo.  When working in that model, `.git` is not a
directory but a file with some magic content in it that tells git
how to find the original source repo and branch.  Just check for the
existence of a `.git` (file or directory) rather than requiring it to
explicitly be a directory.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I90d01894cab38493d464da47d1ce32b5da467857
diff --git a/scripts/format-code.sh b/scripts/format-code.sh
index 0000189..57fb88b 100755
--- a/scripts/format-code.sh
+++ b/scripts/format-code.sh
@@ -68,8 +68,8 @@
 else
     DIR="$(git -C "$1" rev-parse --show-toplevel)"
 fi
-if [ ! -d "$DIR/.git" ]; then
-    echo "${RED}Error:${NORMAL} Directory ($DIR) does not appear to be a git repository"
+if [ ! -e "$DIR/.git" ]; then
+    echo -e "${RED}Error:${NORMAL} Directory ($DIR) does not appear to be a git repository"
     exit 1
 fi