#!/usr/bin/env bash

ENVIRONMENT="${@:-local}"

# TODO: Add Windows support.

if [ ! -d "tests/visual-regression/output/${ENVIRONMENT}/html_report/" ]; then
    exit 1;
fi

if [[ "$OSTYPE" == "darwin"* ]]; then
    # Mac OS.
    open tests/visual-regression/output/${ENVIRONMENT}/html_report/index.html;
else
    # Linux.
    xdg-open tests/visual-regression/output/${ENVIRONMENT}/html_report/index.html;
fi
