Skip to content

Commit

Permalink
Do not follow symlinks (#30)
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu authored Nov 2, 2023
1 parent 7b10974 commit 02a63d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "chen"
ThisBuild / organization := "io.appthreat"
ThisBuild / version := "0.6.0"
ThisBuild / version := "0.6.1"
ThisBuild / scalaVersion := "3.3.1"

val cpgVersion = "1.4.22"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object SourceFiles {

private def isIgnoredByDefault(filePath: String, config: X2CpgConfig[_]): Boolean = {
val relPath = toRelativePath(filePath, config.inputPath)
if (config.defaultIgnoredFilesRegex.exists(_.matches(relPath))) {
if (config.defaultIgnoredFilesRegex.exists(_.matches(relPath)) || File(filePath).isSymbolicLink) {
logger.debug(s"'$relPath' ignored by default")
true
} else {
Expand Down Expand Up @@ -85,7 +85,7 @@ object SourceFiles {

val matchingFiles = files.filter(hasSourceFileExtension).map(_.toString)
val matchingFilesFromDirs = dirs
.flatMap(_.listRecursively(VisitOptions.follow))
.flatMap(_.listRecursively(VisitOptions.default))
.filter(hasSourceFileExtension)
.map(_.pathAsString)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "appthreat-chen"
version = "0.6.0"
version = "0.6.1"
description = "Code Hierarchy Exploration Net (chen)"
authors = ["Team AppThreat <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 02a63d8

Please sign in to comment.