From 3876d2e16a888d1082922fc7d9316b8ec4b7e6db Mon Sep 17 00:00:00 2001 From: David Fowler Date: Sat, 24 Oct 2015 03:59:39 -0700 Subject: [PATCH] Changes to publish - Return error for invalid runtime ids - Change output to be rid specific --- src/Microsoft.DotNet.Tools.Publish/Program.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.DotNet.Tools.Publish/Program.cs b/src/Microsoft.DotNet.Tools.Publish/Program.cs index ad3ed6c20..a395cd218 100644 --- a/src/Microsoft.DotNet.Tools.Publish/Program.cs +++ b/src/Microsoft.DotNet.Tools.Publish/Program.cs @@ -49,6 +49,13 @@ namespace Microsoft.DotNet.Tools.Publish var fx = NuGetFramework.Parse(framework.Value()); var rids = new[] { runtime.Value() }; var context = ProjectContext.Create(path, fx, rids); + + if (string.IsNullOrEmpty(context.RuntimeIdentifier)) + { + Reporter.Output.WriteLine($"Unknown runtime identifier {runtime.Value()}.".Red()); + return 1; + } + return Publish(context, output.Value(), configuration.Value() ?? Constants.DefaultConfiguration); }); @@ -97,7 +104,7 @@ namespace Microsoft.DotNet.Tools.Publish Constants.BinDirectoryName, configuration, context.TargetFramework.GetTwoDigitShortFolderName(), - "publish"); + context.RuntimeIdentifier); } if (!Directory.Exists(outputPath))