public override int Execute() { ToolAppliedOption.EnsureNoConflictGlobalLocalToolPathOption( _parseResult, LocalizableStrings.InstallToolCommandInvalidGlobalAndLocalAndToolPath); ToolAppliedOption.EnsureToolManifestAndOnlyLocalFlagCombination( _parseResult); if (_global || !string.IsNullOrWhiteSpace(_toolPath)) { return(_toolInstallGlobalOrToolPathCommand.Execute()); } else { if (!string.IsNullOrWhiteSpace(_framework)) { throw new GracefulException( string.Format( LocalizableStrings.LocalOptionDoesNotSupportFrameworkOption)); } return(_toolInstallLocalCommand.Execute()); } }
public override int Execute() { EnsureNoConflictGlobalLocalToolPathOption(); if (_global || !string.IsNullOrWhiteSpace(_toolPath)) { if (!string.IsNullOrWhiteSpace(_toolManifestOption)) { throw new GracefulException( string.Format( LocalizableStrings.OnlyLocalOptionSupportManifestFileOption)); } return(_toolInstallGlobalOrToolPathCommand.Execute()); } else { if (!string.IsNullOrWhiteSpace(_framework)) { throw new GracefulException( string.Format( LocalizableStrings.LocalOptionDoesNotSupportFrameworkOption)); } return(_toolInstallLocalCommand.Execute()); } }