#!/bin/bash
#
# Wrapper for the OVH mutualisé cron interface, which only accepts a single
# script path — no arguments, no spaces — so `php artisan schedule:run`
# can't be entered directly. Point OVH's cron job at this file instead
# (path relative to the SSH account's home directory: Joseph/cron-schedule.sh),
# scheduled to run every minute; Laravel's scheduler itself decides what
# actually needs to run each time (see routes/console.php).
#
cd "$(dirname "$0")" || exit 1

PHP_BIN=$(command -v php || echo /usr/bin/php)

"$PHP_BIN" artisan schedule:run >> storage/logs/cron.log 2>&1
