#!/bin/sh

# This is more portable than `which' but comes with
# the caveat of not(?) properly working on busybox's ash:
existence()
{
    type "$1" >/dev/null 2>&1
}

if ! existence go; then
  echo "Go binary not in $PATH!"
  exit 1
fi

if [ -d ".git" ]; then
  mkdir -p internal/gana
  git submodule update --init --recursive
  git submodule sync --recursive
fi
