"use strict";
class RemovePlatformCommand {
    constructor($platformService, $errors) {
        this.$platformService = $platformService;
        this.$errors = $errors;
        this.allowedParameters = [];
    }
    execute(args) {
        return (() => {
            this.$platformService.removePlatforms(args).wait();
        }).future()();
    }
    canExecute(args) {
        return (() => {
            if (!args || args.length === 0) {
                this.$errors.fail("No platform specified. Please specify a platform to remove");
            }
            _.each(args, arg => this.$platformService.validatePlatformInstalled(arg));
            return true;
        }).future()();
    }
}
exports.RemovePlatformCommand = RemovePlatformCommand;
$injector.registerCommand("platform|remove", RemovePlatformCommand);
