Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Ensure paths from the runtime have a predictable drive letter casing
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Oct 12, 2016
1 parent 2c8d64e commit aa95be1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vscode-chrome-debug-core",
"displayName": "vscode-chrome-debug-core",
"version": "3.0.1",
"version": "3.0.2",
"description": "A library for building VS Code debug adapters for targets that support the Chrome Remote Debug Protocol",
"repository": {
"type": "git",
Expand Down
4 changes: 3 additions & 1 deletion src/chrome/chromeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,9 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
return;
}

if (!script.url) {
if (script.url) {
script.url = utils.fixDriveLetterAndSlashes(script.url);
} else {
script.url = ChromeDebugAdapter.PLACEHOLDER_URL_PROTOCOL + script.scriptId;
}

Expand Down
2 changes: 2 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ export function forceForwardSlashes(aUrl: string): string {
* Ensure lower case drive letter and \ on Windows
*/
export function fixDriveLetterAndSlashes(aPath: string, uppercaseDriveLetter = false): string {
if (!aPath) return aPath;

if (aPath.match(/file:\/\/\/[A-Za-z]:/)) {
const prefixLen = 'file:///'.length;
aPath =
Expand Down

0 comments on commit aa95be1

Please sign in to comment.