"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseAutoinstallerAction = void 0;
const BaseRushAction_1 = require("./BaseRushAction");
const Autoinstaller_1 = require("../../logic/Autoinstaller");
class BaseAutoinstallerAction extends BaseRushAction_1.BaseRushAction {
    constructor(options) {
        super(options);
        this._name = this.defineStringParameter({
            parameterLongName: '--name',
            argumentName: 'AUTOINSTALLER_NAME',
            required: true,
            description: 'The name of the autoinstaller, which must be one of the folders under common/autoinstallers.'
        });
    }
    async runAsync() {
        const autoinstallerName = this._name.value;
        const autoinstaller = new Autoinstaller_1.Autoinstaller({
            autoinstallerName,
            rushConfiguration: this.rushConfiguration,
            rushGlobalFolder: this.rushGlobalFolder
        });
        await this.prepareAsync(autoinstaller);
        this.terminal.writeLine();
        this.terminal.writeLine('Success.');
    }
}
exports.BaseAutoinstallerAction = BaseAutoinstallerAction;
//# sourceMappingURL=BaseAutoinstallerAction.js.map