UNPKG

nativescript

Version:

Command-line interface for building NativeScript projects

30 lines 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RemovePlatformCommand = void 0; const _ = require("lodash"); const yok_1 = require("../common/yok"); class RemovePlatformCommand { constructor($errors, $platformCommandHelper, $platformValidationService, $projectData) { this.$errors = $errors; this.$platformCommandHelper = $platformCommandHelper; this.$platformValidationService = $platformValidationService; this.$projectData = $projectData; this.allowedParameters = []; this.$projectData.initializeProjectData(); } execute(args) { return this.$platformCommandHelper.removePlatforms(args, this.$projectData); } async canExecute(args) { if (!args || args.length === 0) { this.$errors.failWithHelp("No platform specified. Please specify a platform to remove."); } _.each(args, (platform) => { this.$platformValidationService.validatePlatform(platform, this.$projectData); }); return true; } } exports.RemovePlatformCommand = RemovePlatformCommand; yok_1.injector.registerCommand("platform|remove", RemovePlatformCommand); //# sourceMappingURL=remove-platform.js.map