public override async Task <int> ExecuteAsync() { try { RemoteFactory remoteFactory = new RemoteFactory(_options); var barOnlyRemote = await remoteFactory.GetBarOnlyRemoteAsync(Logger); List <DefaultChannel> defaultChannels = (await barOnlyRemote.GetDefaultChannelsAsync()).ToList(); defaultChannels.Add( new DefaultChannel(0, "https://github.com/dotnet/arcade", true) { Branch = "master", Channel = await barOnlyRemote.GetChannelAsync(".NET Tools - Latest") } ); defaultChannels.Add( new DefaultChannel(0, "https://github.com/dotnet/arcade", true) { Branch = "release/3.x", Channel = await barOnlyRemote.GetChannelAsync(".NET 3 Tools") } ); List <Subscription> subscriptions = (await barOnlyRemote.GetSubscriptionsAsync()).ToList(); // Build, then prune out what we don't want to see if the user specified // channels. DependencyFlowGraph flowGraph = DependencyFlowGraph.Build(defaultChannels, subscriptions); Channel targetChannel = null; if (!string.IsNullOrEmpty(_options.Channel)) { // Resolve the channel. targetChannel = await UxHelpers.ResolveSingleChannel(barOnlyRemote, _options.Channel); if (targetChannel == null) { return(Constants.ErrorCode); } } if (targetChannel != null) { flowGraph.PruneGraph(node => IsInterestingNode(targetChannel, node), edge => IsInterestingEdge(edge)); } await LogGraphViz(targetChannel, flowGraph); return(Constants.SuccessCode); } catch (Exception exc) { Logger.LogError(exc, "Something failed while getting the dependency graph."); return(Constants.ErrorCode); } }