clarify error when no project.json in the path

also correct help information

fixes #356
This commit is contained in:
Andrew Stanton-Nurse 2015-11-30 16:30:28 -08:00
parent 06037ce143
commit 8da5c7071f

View file

@ -29,9 +29,9 @@ namespace Microsoft.DotNet.Tools.Compiler
DebugHelper.HandleDebugSwitch(ref args);
var app = new CommandLineApplication();
app.Name = "dotnet compile";
app.FullName = ".NET Compiler";
app.Description = "Compiler for the .NET Platform";
app.Name = "dotnet pack";
app.FullName = ".NET Packager";
app.Description = "Packager for the .NET Platform";
app.HelpOption("-h|--help");
var output = app.Option("-o|--output <OUTPUT_DIR>", "Directory in which to place outputs", CommandOptionType.SingleValue);
@ -48,6 +48,17 @@ namespace Microsoft.DotNet.Tools.Compiler
path = Directory.GetCurrentDirectory();
}
if(!path.EndsWith(Project.FileName))
{
path = Path.Combine(path, Project.FileName);
}
if(!File.Exists(path))
{
Reporter.Error.WriteLine($"Unable to find a project.json in {path}");
return 1;
}
var configValue = configuration.Value() ?? Cli.Utils.Constants.DefaultConfiguration;
var outputValue = output.Value();