"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.prepareTunnelEnvironment = void 0;
//@ts-ignore
const execution_grid_tunnel_1 = require("@applitools/execution-grid-tunnel");
async function prepareTunnelEnvironment({ settings, logger, }) {
    try {
        await (0, execution_grid_tunnel_1.prepareEnvironment)({
            egTunnelManagerUrl: settings === null || settings === void 0 ? void 0 : settings.tunnelServerUrl,
            customTestCacheDirectoryPath: settings === null || settings === void 0 ? void 0 : settings.cacheDir,
            logger,
        });
    }
    catch (error) {
        if (error.message !== 'PREPARE_ENV_ALREADY_RUNNING')
            throw error;
    }
}
exports.prepareTunnelEnvironment = prepareTunnelEnvironment;
