Skip to content

Commit

Permalink
fix: remove leading slash
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Nov 30, 2023
1 parent 354517c commit 0d1c52a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stacktrace/stringify.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ParsedStack } from 'vitest'

const repository = process.env.GITHUB_WORKSPACE ?? ''
const repositoryPrefixes = [repository]
const repository = process.env.GITHUB_WORKSPACE
const repositoryPrefixes = repository ? [repository.replace(/\/?$/, '/')] : []

export const stringifyStacktrace = (
stack: ParsedStack[],
Expand All @@ -10,7 +10,7 @@ export const stringifyStacktrace = (
return stack
.map(s => {
let file = s.file
if (trimRepositoryPrefix) {
if (trimRepositoryPrefix && repositoryPrefixes.length > 0) {
file = trimPrefixes(file, repositoryPrefixes)
}

Expand Down

0 comments on commit 0d1c52a

Please sign in to comment.