Code coverage report for lib/commands/remove-platform.js

Statements: 85% (17 / 20)      Branches: 100% (4 / 4)      Functions: 71.43% (5 / 7)      Lines: 84.21% (16 / 19)      Ignored: none     

All files » lib/commands/ » remove-platform.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29    1 1 5 5 5   1           1 5 5 5 1   6 2     1   1 1  
///<reference path="../.d.ts"/>
"use strict";
var RemovePlatformCommand = (function () {
    function RemovePlatformCommand($platformService, $errors) {
        this.$platformService = $platformService;
        this.$errors = $errors;
        this.allowedParameters = [];
    }
    RemovePlatformCommand.prototype.execute = function (args) {
        var _this = this;
        return (function () {
            _this.$platformService.removePlatforms(args).wait();
        }).future()();
    };
    RemovePlatformCommand.prototype.canExecute = function (args) {
        var _this = this;
        return (function () {
            if (!args || args.length === 0) {
                _this.$errors.fail("No platform specified. Please specify a platform to remove");
            }
            _.each(args, function (arg) { return _this.$platformService.validatePlatformInstalled(arg); });
            return true;
        }).future()();
    };
    return RemovePlatformCommand;
})();
exports.RemovePlatformCommand = RemovePlatformCommand;
$injector.registerCommand("platform|remove", RemovePlatformCommand);