File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,23 @@ infer_package_manager() {
31
31
fi
32
32
}
33
33
34
- BENCH_PACKAGE_COUNT=$(
35
- find node_modules -name package.json -type f \
36
- | grep -E ' node_modules/([a-zA-Z0-9_-]+)/package\.json$|node_modules/@[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+/package\.json$' \
37
- | sort -u \
38
- | wc -l \
39
- | xargs
40
- ) || echo " 0"
34
+ # If the node_modules directory exists, count the number of packages
35
+ if [ -d " node_modules" ]; then
36
+ BENCH_PACKAGE_COUNT=$(
37
+ find node_modules -name package.json -type f \
38
+ | grep -E ' node_modules/([a-zA-Z0-9_-]+)/package\.json$|node_modules/@[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+/package\.json$' \
39
+ | sort -u \
40
+ | wc -l \
41
+ | xargs
42
+ )
43
+ else
44
+ BENCH_PACKAGE_COUNT=" 0"
45
+ fi
46
+
47
+ # If the package count is not set, set it to 0
48
+ if [ -z " ${BENCH_PACKAGE_COUNT:- } " ]; then
49
+ BENCH_PACKAGE_COUNT=" 0"
50
+ fi
41
51
42
52
BENCH_PACKAGE_MANAGER=$(
43
53
infer_package_manager
You can’t perform that action at this time.
0 commit comments