Skip to content

Commit

Permalink
fix: add path to replace
Browse files Browse the repository at this point in the history
  • Loading branch information
ldiego73 committed Jun 15, 2020
1 parent 5c8f502 commit 7a1ef36
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions jest-sonar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ const replace = require("replace-in-file")

async function run() {
try {
const regex = new RegExp(
"/home/ldiego/Documents/Github/ldiego73.github.io",
"gi"
)
const regex = path => new RegExp(path, "gi")
const results = await replace({
files: "reports/test/result.xml",
from: regex,
from: [
regex("/home/ldiego/Documents/Github/ldiego73.github.io"),
regex("/home/runner/work/ldiego73.github.io/ldiego73.github.io"),
],
to: "/github/workspace",
})
console.log("Replacement results:", results)
Expand Down

0 comments on commit 7a1ef36

Please sign in to comment.