@@ -28,6 +28,21 @@ appendNonEmpty() {
2828 fi
2929}
3030
31+ findPackageJsonFiles () {
32+ find -L " ${1} " \
33+ -type d -name " node_modules" -prune -o \
34+ -type d -name " dist" -prune -o \
35+ -type d -name " .yalc" -prune -o \
36+ -type d -name " target" -prune -o \
37+ -type d -name " temp" -prune -o \
38+ -type d -name " lib" -prune -o \
39+ -type d -name " libs" -prune -o \
40+ -type d -name " .git" -prune -o \
41+ -name ' package.json' \
42+ -print0 | \
43+ xargs -0 -r -I {} echo {}
44+ }
45+
3146# Collect all files and directories to scan
3247directoriesAndFilesToScan=" "
3348
@@ -45,6 +60,7 @@ if [ -d "./${SOURCE_DIRECTORY}" ] ; then
4560 -type d -name " dist" -prune -o \
4661 -type d -name " target" -prune -o \
4762 -type d -name " .yalc" -prune -o \
63+ -type d -name " .git" -prune -o \
4864 -type d -name " temp" -prune -o \
4965 -type f -path " */.reports/jqa/ts-output.json" \
5066 -exec echo typescript:project::{} \; | tr ' \n' ' ,' | sed ' s/,$/\n/' ) "
@@ -54,12 +70,12 @@ if [ -d "./${SOURCE_DIRECTORY}" ] ; then
5470 fi
5571
5672 # Scan package.json files for npm (nodes package manager) in the source directory
57- # # TODO The following lines can be reactivated when the following issue is resolved :
73+ # Since the following issue had been resolved, the scan be done here again :
5874 # https://github.com/jqassistant-plugin/jqassistant-npm-plugin/issues/5
59- # npmPackageJsonFiles="$(find -L " ${SOURCE_DIRECTORY}" -type d -name node_modules -prune -o -name 'package.json' -print0 | xargs -0 -r -I {} | tr '\n' ',' | sed 's/,$/\n/' )"
60- # if [ -n "${npmPackageJsonFiles}" ]; then
61- # directoriesAndFilesToScan="$(appendNonEmpty "${directoriesAndFilesToScan}")${npmPackageJsonFiles}"
62- # fi
75+ npmPackageJsonFiles=" $( findPackageJsonFiles " ./ ${SOURCE_DIRECTORY} " ) "
76+ if [ -n " ${npmPackageJsonFiles} " ]; then
77+ directoriesAndFilesToScan=" $( appendNonEmpty " ${directoriesAndFilesToScan} " ) ${npmPackageJsonFiles} "
78+ fi
6379
6480 # Scan git repositories in the artifacts directory
6581 if [ " ${IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT} " = " " ] || [ " ${IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT} " = " plugin" ] ; then
0 commit comments