Skip to content

Commit

Permalink
Extra debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
fpoli committed Feb 23, 2024
1 parent ceca726 commit 4ccff7f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/test/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ function workspacePath(): string {
* @returns The computed relative path.
*/
function asRelativeWorkspacePath(target: vscode.Uri): string {
// Sometimes, but not always, some paths on MacOS GitHub runners start with "/private/".
// This might be due to hardlinks in GitHub runners, that are difficult to normalize.
// So, we manually remove the "/private/" prefix if it is present.
if (target.fsPath.startsWith("/private/")) {
return vscode.workspace.asRelativePath(target.fsPath.slice(8));
}
return vscode.workspace.asRelativePath(target);
let normalizedTarget = path.normalize(target.fsPath);

Check failure on line 29 in src/test/extension.test.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest)

'normalizedTarget' is never reassigned. Use 'const' instead

Check failure on line 29 in src/test/extension.test.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

'normalizedTarget' is never reassigned. Use 'const' instead

Check failure on line 29 in src/test/extension.test.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest)

'normalizedTarget' is never reassigned. Use 'const' instead
let normalizedWorkspace = path.normalize(workspacePath());

Check failure on line 30 in src/test/extension.test.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest)

'normalizedWorkspace' is never reassigned. Use 'const' instead

Check failure on line 30 in src/test/extension.test.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

'normalizedWorkspace' is never reassigned. Use 'const' instead

Check failure on line 30 in src/test/extension.test.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest)

'normalizedWorkspace' is never reassigned. Use 'const' instead
let relative = path.relative(normalizedWorkspace, normalizedTarget).replace(/\\/g, "/");

Check failure on line 31 in src/test/extension.test.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest)

'relative' is never reassigned. Use 'const' instead

Check failure on line 31 in src/test/extension.test.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

'relative' is never reassigned. Use 'const' instead

Check failure on line 31 in src/test/extension.test.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest)

'relative' is never reassigned. Use 'const' instead
console.log(`Target path: ${normalizedTarget}`);
console.log(`Workspace path: ${normalizedWorkspace}`);
console.log(`Relative path: ${relative}`);
return relative;
}

/**
Expand Down

0 comments on commit 4ccff7f

Please sign in to comment.