#!/usr/bin/env bash

# Configure shell.
set -e -u +x

# User-friendly print wrapper.
log() {
  printf '[%s] [%s] %s\n' "${0##*/}" "$( date '+%Y-%m-%dT%H:%M:%S' )" "${@}"
}

# This is ultimately not required as checkov will update module sources to use HTTPS,
# but omitting it will cause checkov to hang until host key verification is entered
export GIT_SSH_COMMAND="/usr/bin/ssh -l git -o StrictHostKeyChecking=no"

# Launch application.
log 'Launching terraform-scanner'
exec python /app/terraform-scanner/main.py
