#!/bin/bash
set -e -o pipefail

KEYFILE=$HOME/.expo-internal/turtle-git-crypt-key

if [ ! -f "$KEYFILE" ]; then
  echo "Missing keyfile, running update-local-secrets first"
  update-local-secrets --keyfile-only
fi

if ! command -v git-crypt >/dev/null 2>&1 ; then
  echo "You need to have git-crypt installed."
  exit 1
fi

git-crypt unlock "$KEYFILE"
