Skip to content

Commit

Permalink
Merge pull request #52 from gregg-miskelly/MissingContentFileDetection
Browse files Browse the repository at this point in the history
Add error detection for when content files don't get copied.
  • Loading branch information
DustinCampbell committed Mar 1, 2016
2 parents 33d0c85 + 5622af2 commit ddb72b3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/coreclr-debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export function installCoreClrDebug(context: vscode.ExtensionContext) {
spawnChildProcess('dotnet', ['--verbose', 'restore'], _channel, _coreClrDebugDir)
.then(function() {
return spawnChildProcess('dotnet', ['--verbose', 'publish', '-o', _debugAdapterDir], _channel, _coreClrDebugDir);
}).then(function() {
return ensureAd7EngineExists(_channel, _debugAdapterDir);
}).then(function() {
var promises: Promise<void>[] = [];

Expand Down Expand Up @@ -147,6 +149,28 @@ function getPlatformLibExtension() : string {
}
}

function ensureAd7EngineExists(channel: vscode.OutputChannel, outputDirectory: string) : Promise<void> {
let filePath = path.join(outputDirectory, "coreclr.ad7Engine.json");
return new Promise<void>((resolve, reject) => {
fs.exists(filePath, (exists) => {
if (exists) {
return resolve();
} else {
channel.appendLine(`${filePath} does not exist.`);
channel.appendLine('');
// NOTE: The minimum build number is actually less than 1584, but this is the minimum
// build that I have tested.
channel.appendLine("Error: The .NET CLI did not correctly restore debugger files. Ensure that you have .NET CLI version 1.0.0 build #001584 or newer. You can check your .NET CLI version using 'dotnet --version'.");
// TODO: remove the Linux-specific instructions once http://dotnet.github.io/getting-started/ is pointing at a newer build.
if (process.platform === "linux") {
channel.appendLine("To update your build of the .NET Tools, run: sudo apt-get install dotnet=1.0.0.001584-1");
}
return reject("The .NET CLI did not correctly restore debugger files.");
}
});
});
}

function spawnChildProcess(process: string, args: string[], channel: vscode.OutputChannel, workingDirectory: string) : Promise<void> {
var promise = new Promise<void>( function (resolve, reject) {
const child = child_process.spawn(process, args, {cwd: workingDirectory});
Expand Down

0 comments on commit ddb72b3

Please sign in to comment.