// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { BaseRushAction } from './BaseRushAction';
import { Autoinstaller } from '../../logic/Autoinstaller';
export class BaseAutoinstallerAction extends 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({
            autoinstallerName,
            rushConfiguration: this.rushConfiguration,
            rushGlobalFolder: this.rushGlobalFolder
        });
        await this.prepareAsync(autoinstaller);
        this.terminal.writeLine();
        this.terminal.writeLine('Success.');
    }
}
//# sourceMappingURL=BaseAutoinstallerAction.js.map