From 1c44d2566eb73d0a5ceba434a4e7dc873fac0d5e Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Mon, 14 Mar 2016 18:41:08 -0700 Subject: [PATCH] copy the deps json for packaged commands --- src/dotnet/commands/dotnet-restore/Program.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dotnet/commands/dotnet-restore/Program.cs b/src/dotnet/commands/dotnet-restore/Program.cs index 1b530edb0..806604cf6 100644 --- a/src/dotnet/commands/dotnet-restore/Program.cs +++ b/src/dotnet/commands/dotnet-restore/Program.cs @@ -162,14 +162,21 @@ namespace Microsoft.DotNet.Tools.Restore Path.GetDirectoryName(toolDescription.RuntimeAssemblies.First().Path), toolDescription.Identity.Name + FileNameSuffixes.Deps); + var depsJsonPath = Path.Combine( + toolDescription.Path, + Path.GetDirectoryName(toolDescription.RuntimeAssemblies.First().Path), + toolDescription.Identity.Name + FileNameSuffixes.DepsJson); + var calculator = context.GetOutputPaths(Constants.DefaultConfiguration, buidBasePath: null, outputPath: context.ProjectDirectory); var executable = new Executable(context, calculator, context.CreateExporter(Constants.DefaultConfiguration), null); executable.MakeCompilationOutputRunnable(); if (File.Exists(depsPath)) File.Delete(depsPath); + if (File.Exists(depsJsonPath)) File.Delete(depsJsonPath); File.Move(Path.Combine(calculator.RuntimeOutputPath, "bin" + FileNameSuffixes.Deps), depsPath); + File.Move(Path.Combine(calculator.RuntimeOutputPath, "bin" + FileNameSuffixes.DepsJson), depsJsonPath); } private static bool RestoreToolToPath(LibraryRange tooldep, IEnumerable args, string tempPath, bool quiet)