#!/command/with-contenv bash

# Exit on error
set -e

# Check to see if an Artisan file exists and assume it means Laravel is configured.
if [ -f "$APP_BASE_DIR/artisan" ]; then
        echo "🚀 Starting Laravel Scheduler..."

        cd "$APP_BASE_DIR"
        php "$APP_BASE_DIR/artisan" schedule:work
else
    echo "👉 Skipping Laravel Scheduler because we could not detect a Laravel install or it was specifically disabled..."

    tail -f /dev/null
fi
