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