Skip to content

Commit

Permalink
Removed CI mode (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-leuthaeuser authored Feb 21, 2023
1 parent 9f0c015 commit 857c2a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
10 changes: 2 additions & 8 deletions src/main/scala/io/shiftleft/js2cpg/core/Js2Cpg.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ class Js2Cpg {
}
}

private def isInCi: Boolean = sys.env.get("CI").contains("true")

private def collectJsFiles(jsFiles: List[(Path, Path)], dir: Path, config: Config): List[(Path, Path)] = {
val transpiledJsFiles = FileUtils
.getFileTree(dir, config, List(JS_SUFFIX, MJS_SUFFIX))
Expand Down Expand Up @@ -164,12 +162,8 @@ class Js2Cpg {
logger.info(s"Generating CPG from Javascript sources in: '$absoluteProjectPath'")
logger.debug(s"Configuration:$configWithAbsolutProjectPath")

if (isInCi) {
prepareAndGenerateCpg(project, File(absoluteProjectPath), configWithAbsolutProjectPath)
} else {
File.usingTemporaryDirectory(project.name) { tmpProjectDir =>
prepareAndGenerateCpg(project, tmpProjectDir, configWithAbsolutProjectPath)
}
File.usingTemporaryDirectory(project.name) { tmpProjectDir =>
prepareAndGenerateCpg(project, tmpProjectDir, configWithAbsolutProjectPath)
}

logger.info("Generation of CPG is complete.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class TranspilationRunner(projectPath: Path, tmpTranspileDir: Path, config: Conf
// remove project specific engine restrictions and script hooks
jsonObject.remove("engines")
jsonObject.remove("scripts")
jsonObject.remove("comments")

packageJson.writeText(mapper.writeValueAsString(json))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ class VueTranspiler(override val config: Config, override val projectPath: Path)
override def shouldRun(): Boolean = config.vueTranspiling && isVueProject(config, projectPath)

private def nodeOptions(): Map[String, String] = {
// TODO: keep this until https://github.com/webpack/webpack/issues/14532 is fixed
if (nodeVersion().exists(v => v.startsWith("v17") || v.startsWith("v18") || v.startsWith("v19"))) {
// TODO: keep this until https://github.com/webpack/webpack/issues/14532 is fixed.
// This hack is not required on MacOS.
if (
!scala.util.Properties.isMac &&
nodeVersion().exists(v => v.startsWith("v17") || v.startsWith("v18") || v.startsWith("v19"))
) {
Map("NODE_OPTIONS" -> "--openssl-legacy-provider")
} else {
Map.empty
Expand Down

0 comments on commit 857c2a2

Please sign in to comment.