#!/usr/bin/env bash
if [ ! -x node_modules/.bin/yak ]; then
  if [ -z "$APP_NAME" ]; then
    APP_NAME=${PWD##*/}
    export APP_NAME=${APP_NAME//-} # (basename of the current directory)
  fi
  if [ -z "$APP_TAG" ]; then
    export APP_TAG=latest
  fi
  docker-compose up -d app
  docker-compose exec app npm install
fi

node_modules/.bin/yak $@
