Skip to content

Commit

Permalink
Another try.
Browse files Browse the repository at this point in the history
  • Loading branch information
max-leuthaeuser committed Sep 16, 2021
1 parent 32ae5a5 commit 9073afd
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/main/scala/io/shiftleft/js2cpg/parser/JsSource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,13 @@ class JsSource(val srcDir: File, val projectDir: Path, val source: Source) {
srcDir / replacedName
case _ =>
val replacedName = FileUtils.cleanPath(sourceFileName)
logger.debug(s"""
|>>> constructSourceFilePath:
|TMP: '$tmpDir'
|replacedName: '$replacedName'
|""".stripMargin)
val srcFilePath: File = if (replacedName.contains(tmpDir)) {
// on MacOS the path to the tmp dir is already there
File("/") / replacedName
} else {
// on all other OS we have to prepend it with special handling for Windows:
if (replacedName.contains("AppData/Local/Temp")) {
File("/Users") / replacedName
srcDir.root / "Users" / replacedName
} else {
File(tmpDir) / replacedName
}
Expand Down

0 comments on commit 9073afd

Please sign in to comment.