Skip to content

Commit

Permalink
[jssrc2cpg] astgen update (#5112)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-leuthaeuser authored Nov 19, 2024
1 parent 0fe79d1 commit a322bf4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jssrc2cpg {
astgen_version: "3.17.0"
astgen_version: "3.19.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,15 @@ class AstGenRunner(config: Config) {

val jsons = SourceFiles.determine(out.toString(), Set(".json"))
jsons.foreach { jsonPath =>
val jsonFile = File(jsonPath)
val jsonContent = IOUtils.readEntireFile(jsonFile.path)
val json = ujson.read(jsonContent)
val fileName = json("fullName").str
val newFileName = fileName.patch(fileName.lastIndexOf(".js"), ".ejs", 3)
json("relativeName") = newFileName
json("fullName") = newFileName
val jsonFile = File(jsonPath)
val jsonContent = IOUtils.readEntireFile(jsonFile.path)
val json = ujson.read(jsonContent)
val fullName = json("fullName").str
val relativeName = json("relativeName").str
val newFullName = fullName.patch(fullName.lastIndexOf(".js"), ".ejs", 3)
val newRelativeName = relativeName.patch(relativeName.lastIndexOf(".js"), ".ejs", 3)
json("relativeName") = newRelativeName
json("fullName") = newFullName
jsonFile.writeText(json.toString())
}

Expand Down

0 comments on commit a322bf4

Please sign in to comment.