#!/bin/bash
# This script will be called from the Git Hooks on the host and redirect the CaptainHookPHP commands into the phpfpm
# container. For some odd reason it was needed to change the working directory so that CaptainHookPHP can resolve paths
# properly
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit
# make sure the phpfpm container is running before trying to execute the git hook
docker-compose up --no-recreate -d phpfpm
docker-compose exec -w /var/www/html/BitExpert/ForceCustomerLogin/ -T phpfpm "$@"

