/* eslint-disable perfectionist/sort-maps */
import AppConfig from "../../lib/appConfig.js";
import constants from "../../lib/constants.js";
import InfoDisplayer from "../../lib/infoDisplayer.js";
export default class BuildHostConfigDisplayer {
    async display() {
        const appConfig = await AppConfig.getInstance();
        const environmentId = appConfig.getConfig("environmentId", "buildHost");
        if (!environmentId) {
            throw new Error(`Build Host has not been provisioned. Please try \`${constants.APP_NAME} build-host provision --help\`.`);
        }
        if (environmentId) {
            const privateKeyPath = appConfig.getConfigFilePath(constants.BUILD_HOST_PRIVATE_KEY_FILE_NAME);
            const sshPort = appConfig.getConfig("sshPort", "buildHost");
            const sshHost = appConfig.getConfig("sshHost", "buildHost");
            const infoDisplayer = new InfoDisplayer(new Map([
                ["Environment URL", `https://cloud.skytap.com/configurations/${environmentId}`],
                ["SSH destination", `${sshHost}:${sshPort}`],
                ["Private key path", privateKeyPath]
            ]));
            infoDisplayer.displayAsTable();
        }
    }
}
