#!/bin/bash
WIN_DISK="${WIN_DISK}";
workingDir="$(pwd)";
pushd "${BASH_SOURCE%/*}" > /dev/null;
. "./.env" > /dev/null 2>&1;

if [ ! -z "$WIN11_IMAGE_PATH" ]
then
    WIN11_IMAGE_PATH="$(bash -c "realpath $WIN11_IMAGE_PATH")";
fi;

if [ ! -f "$WIN11_IMAGE_PATH" ]
then
    if [ ! -f "./.env" ]
    then
        cp .env.template .env;
    fi;

    echo "Please specify the path to the Windows 11 ISO image in your .env file located at:";
    realpath --relative-to "$workingDir" "$(realpath .env)";
else
    WIN11_IMAGE_PATH="$WIN11_IMAGE_PATH" exec fish ./deploy.fish $@;
fi;

popd > /dev/null;