Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 0 additions & 64 deletions scripts/copyPackageJsonFiles.sh

This file was deleted.

26 changes: 21 additions & 5 deletions scripts/findPathsToScan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ appendNonEmpty() {
fi
}

findPackageJsonFiles() {
find -L "${1}" \
-type d -name "node_modules" -prune -o \
-type d -name "dist" -prune -o \
-type d -name ".yalc" -prune -o \
-type d -name "target" -prune -o \
-type d -name "temp" -prune -o \
-type d -name "lib" -prune -o \
-type d -name "libs" -prune -o \
-type d -name ".git" -prune -o \
-name 'package.json' \
-print0 | \
xargs -0 -r -I {} echo {}
}

# Collect all files and directories to scan
directoriesAndFilesToScan=""

Expand All @@ -45,6 +60,7 @@ if [ -d "./${SOURCE_DIRECTORY}" ] ; then
-type d -name "dist" -prune -o \
-type d -name "target" -prune -o \
-type d -name ".yalc" -prune -o \
-type d -name ".git" -prune -o \
-type d -name "temp" -prune -o \
-type f -path "*/.reports/jqa/ts-output.json" \
-exec echo typescript:project::{} \; | tr '\n' ',' | sed 's/,$/\n/')"
Expand All @@ -54,12 +70,12 @@ if [ -d "./${SOURCE_DIRECTORY}" ] ; then
fi

# Scan package.json files for npm (nodes package manager) in the source directory
# # TODO The following lines can be reactivated when the following issue is resolved:
# Since the following issue had been resolved, the scan be done here again:
# https://github.com/jqassistant-plugin/jqassistant-npm-plugin/issues/5
#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/')"
#if [ -n "${npmPackageJsonFiles}" ]; then
# directoriesAndFilesToScan="$(appendNonEmpty "${directoriesAndFilesToScan}")${npmPackageJsonFiles}"
#fi
npmPackageJsonFiles="$(findPackageJsonFiles "./${SOURCE_DIRECTORY}")"
if [ -n "${npmPackageJsonFiles}" ]; then
directoriesAndFilesToScan="$(appendNonEmpty "${directoriesAndFilesToScan}")${npmPackageJsonFiles}"
fi

# Scan git repositories in the artifacts directory
if [ "${IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT}" = "" ] || [ "${IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT}" = "plugin" ] ; then
Expand Down
5 changes: 1 addition & 4 deletions scripts/resetAndScanChanged.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Note: "resetAndScan" expects jQAssistant to be installed in the "tools" directory.

# Requires resetAndScan.sh, copyPackageJsonFiles.sh, scanTypescript.sh, detectChangedFiles.sh, findPathsToScan.sh
# Requires resetAndScan.sh, scanTypescript.sh, detectChangedFiles.sh, findPathsToScan.sh

# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands)
set -o errexit -o pipefail
Expand All @@ -17,9 +17,6 @@ SCRIPTS_DIR=${SCRIPTS_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
echo "resetAndScanChanged SCRIPTS_DIR=${SCRIPTS_DIR}"

# Prepare scan
# TODO "copyPackageJsonFiles.sh" can be deleted here when the following issue is resolved:
# https://github.com/jqassistant-plugin/jqassistant-npm-plugin/issues/5
source "${SCRIPTS_DIR}/copyPackageJsonFiles.sh"
source "${SCRIPTS_DIR}/scanTypescript.sh"

filesAndDirectoriesToScan=$( source "${SCRIPTS_DIR}/findPathsToScan.sh" )
Expand Down
Loading