Avoid using path.join for sarif uris
These are uris, not paths and always use '/', even on windows.
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import * as Sarif from 'sarif';
|
import * as Sarif from 'sarif';
|
||||||
import * as path from 'path';
|
|
||||||
import { ResolvableLocationValue } from './bqrs-cli-types';
|
import { ResolvableLocationValue } from './bqrs-cli-types';
|
||||||
|
|
||||||
export interface SarifLink {
|
export interface SarifLink {
|
||||||
@@ -74,9 +73,7 @@ export function getPathRelativeToSourceLocationPrefix(
|
|||||||
sarifRelativeUri: string
|
sarifRelativeUri: string
|
||||||
) {
|
) {
|
||||||
const normalizedSourceLocationPrefix = sourceLocationPrefix.replace(/\\/g, '/');
|
const normalizedSourceLocationPrefix = sourceLocationPrefix.replace(/\\/g, '/');
|
||||||
return `file:${
|
return `file:${normalizedSourceLocationPrefix}/${sarifRelativeUri}`;
|
||||||
path.join(normalizedSourceLocationPrefix, sarifRelativeUri)
|
|
||||||
}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseSarifLocation(
|
export function parseSarifLocation(
|
||||||
|
|||||||
Reference in New Issue
Block a user