"use strict";
/*
 * Copyright © 2020 Atomist, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.sdmExtensionPackStartupMessage = exports.sdmStartupMessage = void 0;
const chalk_1 = require("chalk");
const modes_1 = require("../machine/modes");
/**
 * Print some SDM details to the startup banner of the client
 * @param sdm
 */
function sdmStartupMessage(sdm) {
    return () => ({
        title: "SDM",
        body: `${sdm.name}${modes_1.isInLocalMode() ? `  ${chalk_1.default.grey("started in")} ${chalk_1.default.green("local mode")}` : (modes_1.isGitHubAction() ? `  ${chalk_1.default.grey("started as")} ${chalk_1.default.green("GitHub action")}` : "")}`,
    });
}
exports.sdmStartupMessage = sdmStartupMessage;
function sdmExtensionPackStartupMessage(sdm) {
    return () => ({
        title: sdm.extensionPacks.length > 1 ? "Extension Packs" : "Extension Pack",
        body: sdm.extensionPacks.map(ex => `${ex.name}:${ex.version}  ${chalk_1.default.gray("by")} ${ex.vendor}`)
            .sort((e1, e2) => e1.localeCompare(e2)).join("\n"),
    });
}
exports.sdmExtensionPackStartupMessage = sdmExtensionPackStartupMessage;
//# sourceMappingURL=startupMessage.js.map