Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 715cc19

Browse filesBrowse files
committed
include command output in restore exception message
1 parent f4ea82a commit 715cc19
Copy full SHA for 715cc19

File tree

1 file changed

+5
-3
lines changed
Filter options

1 file changed

+5
-3
lines changed

‎src/Dotnet.Script.DependencyModel/Context/DotnetRestorer.cs

Copy file name to clipboardExpand all lines: src/Dotnet.Script.DependencyModel/Context/DotnetRestorer.cs
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ public void Restore(ProjectFileInfo projectFileInfo, string[] packageSources)
3131

3232
_logger.Debug($"Restoring {projectFileInfo.Path} using the dotnet cli. RuntimeIdentifier : {runtimeIdentifier} NugetConfigFile: {projectFileInfo.NuGetConfigFile}");
3333

34-
var exitcode = _commandRunner.Execute("dotnet", $"restore \"{projectFileInfo.Path}\" -r {runtimeIdentifier} {packageSourcesArgument} {configFileArgument}", workingDirectory);
35-
if (exitcode != 0)
34+
var commandPath = "dotnet";
35+
var commandArguments = $"restore \"{projectFileInfo.Path}\" -r {runtimeIdentifier} {packageSourcesArgument} {configFileArgument}";
36+
var commandResult = _commandRunner.Capture(commandPath, commandArguments, workingDirectory);
37+
if (commandResult.ExitCode != 0)
3638
{
3739
// We must throw here, otherwise we may incorrectly run with the old 'project.assets.json'
38-
throw new Exception($"Unable to restore packages from '{projectFileInfo.Path}'. Make sure that all script files contains valid NuGet references");
40+
throw new Exception($"Unable to restore packages from '{projectFileInfo.Path}'{System.Environment.NewLine}Make sure that all script files contains valid NuGet references{System.Environment.NewLine}{System.Environment.NewLine}Details:{System.Environment.NewLine}{workingDirectory} : {commandPath} {commandArguments}{System.Environment.NewLine}{commandResult.StandardOut}");
3941
}
4042

4143
string CreatePackageSourcesArguments()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.