Skip to content

Commit 502c421

Browse files
committed
Update exclusion/inclusion filters
This commit should help with cross-platform interop, as `-not` is not standardized across all `find` implementations. The '!' operator is. For more info, see https://www.man7.org/linux/man-pages/man1/find.1.html.
1 parent 577215c commit 502c421

File tree

6 files changed

+96
-96
lines changed

6 files changed

+96
-96
lines changed

lib/node_modules/@stdlib/_tools/scripts/templates/Makefile.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,21 +280,21 @@ endif
280280

281281
# Common exclude flags that most recipes for finding package files should use (Note: order does matter to some degree):
282282
FIND_COMMON_EXCLUDE_FLAGS ?= \
283-
-not -path "$(ROOT_DIR)/.*" \
284-
-not -path "$(NODE_MODULES)/*" \
285-
-not -path "$(BUILD_DIR)/*" \
286-
-not -path "$(REPORTS_DIR)/*" \
283+
'!' -path "$(ROOT_DIR)/.*" \
284+
'!' -path "$(NODE_MODULES)/*" \
285+
'!' -path "$(BUILD_DIR)/*" \
286+
'!' -path "$(REPORTS_DIR)/*" \
287287

288288
# Define exclusion flags to use when searching for benchmark files:
289289
FIND_BENCHMARKS_EXCLUDE_FLAGS ?= \
290290
$(FIND_COMMON_EXCLUDE_FLAGS) \
291-
-not -path "$(ROOT_DIR)/**/$(BENCHMARKS_FIXTURES_FOLDER)/*"
291+
'!' -path "$(ROOT_DIR)/**/$(BENCHMARKS_FIXTURES_FOLDER)/*"
292292

293293
# Define flags for finding benchmark files:
294294
FIND_BENCHMARKS_FLAGS ?= \
295295
-type f \
296296
-name "$(BENCHMARKS_PATTERN)" \
297-
-path "$(ROOT_DIR)/**$(BENCHMARKS_FOLDER)/**" \
297+
\( -path "$(ROOT_DIR)/$(BENCHMARKS_FOLDER)/**" -o -path "$(ROOT_DIR)/**/$(BENCHMARKS_FOLDER)/**" \) \
298298
-regex "$(BENCHMARKS_FILTER)" \
299299
$(FIND_BENCHMARKS_EXCLUDE_FLAGS)
300300

@@ -308,13 +308,13 @@ FIND_BENCHMARKS_CMD ?= find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_BENCHMARKS_
308308
# Define exclusion flags to use when searching for examples files:
309309
FIND_EXAMPLES_EXCLUDE_FLAGS ?= \
310310
$(FIND_COMMON_EXCLUDE_FLAGS) \
311-
-not -path "$(ROOT_DIR)/**/$(EXAMPLES_FIXTURES_FOLDER)/*"
311+
'!' -path "$(ROOT_DIR)/**/$(EXAMPLES_FIXTURES_FOLDER)/*"
312312

313313
# Define flags for finding examples files:
314314
FIND_EXAMPLES_FLAGS ?= \
315315
-type f \
316316
-name "$(EXAMPLES_PATTERN)" \
317-
-path "$(ROOT_DIR)/**$(EXAMPLES_FOLDER)/**" \
317+
\( -path "$(ROOT_DIR)/$(EXAMPLES_FOLDER)/**" -o -path "$(ROOT_DIR)/**/$(EXAMPLES_FOLDER)/**" \) \
318318
-regex "$(EXAMPLES_FILTER)" \
319319
$(FIND_EXAMPLES_EXCLUDE_FLAGS)
320320

@@ -328,7 +328,7 @@ FIND_EXAMPLES_CMD ?= find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_EXAMPLES_FLAG
328328
# Define exclusion flags to use when searching for test files:
329329
FIND_TESTS_EXCLUDE_FLAGS ?= \
330330
$(FIND_COMMON_EXCLUDE_FLAGS) \
331-
-not -path "$(ROOT_DIR)/**/$(TESTS_FIXTURES_FOLDER)/*"
331+
'!' -path "$(ROOT_DIR)/**/$(TESTS_FIXTURES_FOLDER)/*"
332332

333333
# Define flags for finding test files:
334334
FIND_TESTS_FLAGS ?= \

tools/ci/circle/script

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,9 @@ find_tests() {
365365

366366
# On Mac OSX, in order to use `|` and other regular expression operators, we need to use enhanced regular expression syntax (-E); see https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man7/re_format.7.html#//apple_ref/doc/man/7/re_format.
367367
if [[ "${kernel}" = "Darwin" ]]; then
368-
tests=$(find -E "${root_dir}" -name "${tests_pattern}" -regex "${tests_filter}" -not -path "${root_dir}/.*" -not -path "${node_modules}/*" -not -path "${tools_dir}/*" -not -path "${tools_pkgs_dir}/*" -not -path "${deps_dir}/*" -not -path "${docs_dir}/*" -not -path "${build_dir}/*" -not -path "${dist_dir}/*" -not -path "${reports_dir}/*" -not -path "${root_dir}/**/{tests_fixtures_folder}/*")
368+
tests=$(find -E "${root_dir}" -name "${tests_pattern}" -regex "${tests_filter}" '!' -path "${root_dir}/.*" '!' -path "${node_modules}/*" '!' -path "${tools_dir}/*" '!' -path "${tools_pkgs_dir}/*" '!' -path "${deps_dir}/*" '!' -path "${docs_dir}/*" '!' -path "${build_dir}/*" '!' -path "${dist_dir}/*" '!' -path "${reports_dir}/*" '!' -path "${root_dir}/**/{tests_fixtures_folder}/*")
369369
else
370-
tests=$(find "${root_dir}" -regextype posix-extended -name "${tests_pattern}" -regex "${tests_filter}" -not -path "${root_dir}/.*" -not -path "${node_modules}/*" -not -path "${tools_dir}/*" -not -path "${tools_pkgs_dir}/*" -not -path "${deps_dir}/*" -not -path "${docs_dir}/*" -not -path "${build_dir}/*" -not -path "${dist_dir}/*" -not -path "${reports_dir}/*" -not -path "${root_dir}/**/{tests_fixtures_folder}/*")
370+
tests=$(find "${root_dir}" -regextype posix-extended -name "${tests_pattern}" -regex "${tests_filter}" '!' -path "${root_dir}/.*" '!' -path "${node_modules}/*" '!' -path "${tools_dir}/*" '!' -path "${tools_pkgs_dir}/*" '!' -path "${deps_dir}/*" '!' -path "${docs_dir}/*" '!' -path "${build_dir}/*" '!' -path "${dist_dir}/*" '!' -path "${reports_dir}/*" '!' -path "${root_dir}/**/{tests_fixtures_folder}/*")
371371
fi
372372
echo "${tests}"
373373
}

tools/dev.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ $ find ./search/directory -type f | xargs perl -pi -w -e 's/search/replace/g;'
127127
If running a search from the top-level directory, be sure to exclude any hidden directories (including `.git`), the top-level `node_modules` directory, and the `./deps` directory from the search. This may require using absolute file paths.
128128

129129
```bash
130-
$ find "$PWD" -type f -not -path "$PWD/.*" -not -path "$PWD/deps/*" -not -path "$PWD/node_modules/*" | xargs perl -pi -w -e 's/search/replace/g;'
130+
$ find "$PWD" -type f '!' -path "$PWD/.*" '!' -path "$PWD/deps/*" '!' -path "$PWD/node_modules/*" | xargs perl -pi -w -e 's/search/replace/g;'
131131
```
132132

133133
A few comments:

tools/make/lib/ls/Makefile

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -275,59 +275,59 @@ PACKAGES_FILTER ?= .*/.*
275275

276276
# Minimum set of exclude flags (Note: order does matter to some degree):
277277
FIND_EXCLUDE_FLAGS ?= \
278-
-not -path "$(ROOT_DIR)/.git/*" \
279-
-not -path "$(NODE_MODULES)/*" \
280-
-not -path "$(DOCS_DIR)/**/$(NODE_MODULES_FOLDER)/*" \
281-
-not -path "$(BUILD_DIR)/*" \
282-
-not -path "$(REPORTS_DIR)/*" \
283-
-not -path "$(TMP_DIR)/*" \
284-
-not -path "$(ROOT_DIR)/**/$(BUILD_FOLDER)/*" \
285-
-not -path "$(ROOT_DIR)/**/$(TMP_FOLDER)/*"
278+
'!' -path "$(ROOT_DIR)/.git/*" \
279+
'!' -path "$(NODE_MODULES)/*" \
280+
'!' -path "$(DOCS_DIR)/**/$(NODE_MODULES_FOLDER)/*" \
281+
'!' -path "$(BUILD_DIR)/*" \
282+
'!' -path "$(REPORTS_DIR)/*" \
283+
'!' -path "$(TMP_DIR)/*" \
284+
'!' -path "$(ROOT_DIR)/**/$(BUILD_FOLDER)/*" \
285+
'!' -path "$(ROOT_DIR)/**/$(TMP_FOLDER)/*"
286286

287287
# Common exclude flags that most recipes should use (Note: order does matter to some degree):
288288
FIND_COMMON_EXCLUDE_FLAGS ?= \
289-
-not -path "$(ROOT_DIR)/.*" \
290-
-not -path "$(NODE_MODULES)/*" \
291-
-not -path "$(DOCS_DIR)/**/$(NODE_MODULES_FOLDER)/*" \
292-
-not -path "$(BUILD_DIR)/*" \
293-
-not -path "$(DEPS_DIR)/*" \
294-
-not -path "$(DIST_DIR)/*" \
295-
-not -path "$(REPORTS_DIR)/*" \
296-
-not -path "$(TMP_DIR)/*" \
297-
-not -path "$(ROOT_DIR)/**/$(BUILD_FOLDER)/*" \
298-
-not -path "$(ROOT_DIR)/**/$(TMP_FOLDER)/*"
289+
'!' -path "$(ROOT_DIR)/.*" \
290+
'!' -path "$(NODE_MODULES)/*" \
291+
'!' -path "$(DOCS_DIR)/**/$(NODE_MODULES_FOLDER)/*" \
292+
'!' -path "$(BUILD_DIR)/*" \
293+
'!' -path "$(DEPS_DIR)/*" \
294+
'!' -path "$(DIST_DIR)/*" \
295+
'!' -path "$(REPORTS_DIR)/*" \
296+
'!' -path "$(TMP_DIR)/*" \
297+
'!' -path "$(ROOT_DIR)/**/$(BUILD_FOLDER)/*" \
298+
'!' -path "$(ROOT_DIR)/**/$(TMP_FOLDER)/*"
299299

300300
# Benchmark exclude flags:
301301
FIND_BENCHMARKS_EXCLUDE_FLAGS ?= \
302302
$(FIND_COMMON_EXCLUDE_FLAGS) \
303-
-not -path "$(TOOLS_DIR)/*" \
304-
-not -path "$(TOOLS_PKGS_DIR)/*" \
305-
-not -path "$(ROOT_DIR)/**/$(BENCHMARKS_FIXTURES_FOLDER)/*"
303+
'!' -path "$(TOOLS_DIR)/*" \
304+
'!' -path "$(TOOLS_PKGS_DIR)/*" \
305+
'!' -path "$(ROOT_DIR)/**/$(BENCHMARKS_FIXTURES_FOLDER)/*"
306306

307307
# Examples exclude flags:
308308
FIND_EXAMPLES_EXCLUDE_FLAGS ?= \
309309
$(FIND_COMMON_EXCLUDE_FLAGS) \
310-
-not -path "$(TOOLS_DIR)/*" \
311-
-not -path "$(TOOLS_PKGS_DIR)/*" \
312-
-not -path "$(ROOT_DIR)/**/$(EXAMPLES_FIXTURES_FOLDER)/*"
310+
'!' -path "$(TOOLS_DIR)/*" \
311+
'!' -path "$(TOOLS_PKGS_DIR)/*" \
312+
'!' -path "$(ROOT_DIR)/**/$(EXAMPLES_FIXTURES_FOLDER)/*"
313313

314314
# Files exclude flags:
315315
FIND_FILES_EXCLUDE_FLAGS ?= $(FIND_COMMON_EXCLUDE_FLAGS)
316316

317317
# Library packages exclude flags:
318318
FIND_LIB_PACKAGES_EXCLUDE_FLAGS ?= \
319-
-not -path "$(TOOLS_PKGS_DIR)/*" \
320-
-not -path "$(ROOT_DIR)/**/$(BENCHMARKS_FOLDER)/*" \
321-
-not -path "$(ROOT_DIR)/**/$(BIN_FOLDER)/*" \
322-
-not -path "$(ROOT_DIR)/**/$(DATA_FOLDER)/*" \
323-
-not -path "$(ROOT_DIR)/**/$(DIST_FOLDER)/*" \
324-
-not -path "$(ROOT_DIR)/**/$(EXAMPLES_FOLDER)/*" \
325-
-not -path "$(ROOT_DIR)/**/$(SOURCE_FOLDER)/*" \
326-
-not -path "$(ROOT_DIR)/**/$(SRC_FOLDER)/*" \
327-
-not -path "$(ROOT_DIR)/**/$(TESTS_FOLDER)/*" \
328-
-not -path "$(ROOT_DIR)/**/$(CONFIG_FOLDER)/*" \
329-
-not -path "$(ROOT_DIR)/**/$(DOCUMENTATION_FOLDER)/*" \
330-
-not -path "$(ROOT_DIR)/**/$(SCRIPTS_FOLDER)/*"
319+
'!' -path "$(TOOLS_PKGS_DIR)/*" \
320+
'!' -path "$(ROOT_DIR)/**/$(BENCHMARKS_FOLDER)/*" \
321+
'!' -path "$(ROOT_DIR)/**/$(BIN_FOLDER)/*" \
322+
'!' -path "$(ROOT_DIR)/**/$(DATA_FOLDER)/*" \
323+
'!' -path "$(ROOT_DIR)/**/$(DIST_FOLDER)/*" \
324+
'!' -path "$(ROOT_DIR)/**/$(EXAMPLES_FOLDER)/*" \
325+
'!' -path "$(ROOT_DIR)/**/$(SOURCE_FOLDER)/*" \
326+
'!' -path "$(ROOT_DIR)/**/$(SRC_FOLDER)/*" \
327+
'!' -path "$(ROOT_DIR)/**/$(TESTS_FOLDER)/*" \
328+
'!' -path "$(ROOT_DIR)/**/$(CONFIG_FOLDER)/*" \
329+
'!' -path "$(ROOT_DIR)/**/$(DOCUMENTATION_FOLDER)/*" \
330+
'!' -path "$(ROOT_DIR)/**/$(SCRIPTS_FOLDER)/*"
331331

332332
# Makefile exclude flags:
333333
FIND_MAKEFILES_EXCLUDE_FLAGS ?= $(FIND_EXCLUDE_FLAGS)
@@ -338,81 +338,81 @@ FIND_MARKDOWN_EXCLUDE_FLAGS ?= $(FIND_EXCLUDE_FLAGS)
338338
# Packages exclude flags:
339339
FIND_PACKAGES_EXCLUDE_FLAGS ?= \
340340
$(FIND_COMMON_EXCLUDE_FLAGS) \
341-
-not -path "$(DOCS_DIR)/*" \
342-
-not -path "$(ROOT_DIR)/**/$(BENCHMARKS_FOLDER)/*" \
343-
-not -path "$(ROOT_DIR)/**/$(BIN_FOLDER)/*" \
344-
-not -path "$(ROOT_DIR)/**/$(DATA_FOLDER)/*" \
345-
-not -path "$(ROOT_DIR)/**/$(DIST_FOLDER)/*" \
346-
-not -path "$(ROOT_DIR)/**/$(EXAMPLES_FOLDER)/*" \
347-
-not -path "$(ROOT_DIR)/**/$(SOURCE_FOLDER)/*" \
348-
-not -path "$(ROOT_DIR)/**/$(SRC_FOLDER)/*" \
349-
-not -path "$(ROOT_DIR)/**/$(TESTS_FOLDER)/*" \
350-
-not -path "$(ROOT_DIR)/**/$(CONFIG_FOLDER)/*" \
351-
-not -path "$(ROOT_DIR)/**/$(DOCUMENTATION_FOLDER)/*" \
352-
-not -path "$(ROOT_DIR)/**/$(SCRIPTS_FOLDER)/*"
341+
'!' -path "$(DOCS_DIR)/*" \
342+
'!' -path "$(ROOT_DIR)/**/$(BENCHMARKS_FOLDER)/*" \
343+
'!' -path "$(ROOT_DIR)/**/$(BIN_FOLDER)/*" \
344+
'!' -path "$(ROOT_DIR)/**/$(DATA_FOLDER)/*" \
345+
'!' -path "$(ROOT_DIR)/**/$(DIST_FOLDER)/*" \
346+
'!' -path "$(ROOT_DIR)/**/$(EXAMPLES_FOLDER)/*" \
347+
'!' -path "$(ROOT_DIR)/**/$(SOURCE_FOLDER)/*" \
348+
'!' -path "$(ROOT_DIR)/**/$(SRC_FOLDER)/*" \
349+
'!' -path "$(ROOT_DIR)/**/$(TESTS_FOLDER)/*" \
350+
'!' -path "$(ROOT_DIR)/**/$(CONFIG_FOLDER)/*" \
351+
'!' -path "$(ROOT_DIR)/**/$(DOCUMENTATION_FOLDER)/*" \
352+
'!' -path "$(ROOT_DIR)/**/$(SCRIPTS_FOLDER)/*"
353353

354354
# Sources exclude flags:
355355
FIND_SOURCES_EXCLUDE_FLAGS ?= \
356356
$(FIND_COMMON_EXCLUDE_FLAGS) \
357-
-not -path "$(TOOLS_DIR)/*" \
358-
-not -path "$(TOOLS_PKGS_DIR)/*" \
359-
-not -path "$(ROOT_DIR)/**/$(EXAMPLES_FOLDER)/*" \
360-
-not -path "$(ROOT_DIR)/**/$(TESTS_FOLDER)/*" \
361-
-not -path "$(ROOT_DIR)/**/$(BENCHMARKS_FOLDER)/*" \
362-
-not -path "$(ROOT_DIR)/**/$(DOCUMENTATION_FOLDER)/*" \
363-
-not -path "$(ROOT_DIR)/**/$(SCRIPTS_FOLDER)/*"
357+
'!' -path "$(TOOLS_DIR)/*" \
358+
'!' -path "$(TOOLS_PKGS_DIR)/*" \
359+
'!' -path "$(ROOT_DIR)/**/$(EXAMPLES_FOLDER)/*" \
360+
'!' -path "$(ROOT_DIR)/**/$(TESTS_FOLDER)/*" \
361+
'!' -path "$(ROOT_DIR)/**/$(BENCHMARKS_FOLDER)/*" \
362+
'!' -path "$(ROOT_DIR)/**/$(DOCUMENTATION_FOLDER)/*" \
363+
'!' -path "$(ROOT_DIR)/**/$(SCRIPTS_FOLDER)/*"
364364

365365
# SVG equations exclude flags:
366366
FIND_SVG_EQUATIONS_EXCLUDE_FLAGS ?= $(FIND_COMMON_EXCLUDE_FLAGS)
367367

368368
# Tests exclude flags:
369369
FIND_TESTS_EXCLUDE_FLAGS ?= \
370370
$(FIND_COMMON_EXCLUDE_FLAGS) \
371-
-not -path "$(TOOLS_DIR)/*" \
372-
-not -path "$(TOOLS_PKGS_DIR)/*" \
373-
-not -path "$(ROOT_DIR)/**/$(TESTS_FIXTURES_FOLDER)/*"
371+
'!' -path "$(TOOLS_DIR)/*" \
372+
'!' -path "$(TOOLS_PKGS_DIR)/*" \
373+
'!' -path "$(ROOT_DIR)/**/$(TESTS_FIXTURES_FOLDER)/*"
374374

375375
# Tests directories exclude flags:
376376
FIND_TESTS_DIRS_EXCLUDE_FLAGS ?= \
377377
$(FIND_COMMON_EXCLUDE_FLAGS) \
378-
-not -path "$(TOOLS_DIR)/*" \
379-
-not -path "$(TOOLS_PKGS_DIR)/*"
378+
'!' -path "$(TOOLS_DIR)/*" \
379+
'!' -path "$(TOOLS_PKGS_DIR)/*"
380380

381381
# Text fixtures exclude flags:
382382
FIND_TESTS_FIXTURES_EXCLUDE_FLAGS ?= \
383383
$(FIND_COMMON_EXCLUDE_FLAGS) \
384-
-not -path "$(TOOLS_DIR)/*" \
385-
-not -path "$(TOOLS_PKGS_DIR)/*"
384+
'!' -path "$(TOOLS_DIR)/*" \
385+
'!' -path "$(TOOLS_PKGS_DIR)/*"
386386

387387
# Tools packages exclude flags:
388388
FIND_TOOLS_PACKAGES_EXCLUDE_FLAGS ?= \
389-
-not -path "*/snippets/*" \
390-
-not -path "*/$(BENCHMARKS_FOLDER)/*" \
391-
-not -path "*/$(BIN_FOLDER)/*" \
392-
-not -path "*/$(DATA_FOLDER)/*" \
393-
-not -path "*/$(DIST_FOLDER)/*" \
394-
-not -path "*/$(EXAMPLES_FOLDER)/*" \
395-
-not -path "*/$(CONFIG_FOLDER)/*" \
396-
-not -path "*/$(SCRIPTS_FOLDER)/*"
389+
'!' -path "*/snippets/*" \
390+
'!' -path "*/$(BENCHMARKS_FOLDER)/*" \
391+
'!' -path "*/$(BIN_FOLDER)/*" \
392+
'!' -path "*/$(DATA_FOLDER)/*" \
393+
'!' -path "*/$(DIST_FOLDER)/*" \
394+
'!' -path "*/$(EXAMPLES_FOLDER)/*" \
395+
'!' -path "*/$(CONFIG_FOLDER)/*" \
396+
'!' -path "*/$(SCRIPTS_FOLDER)/*"
397397

398398
# Tools tests exclude flags:
399399
FIND_TOOLS_TESTS_EXCLUDE_FLAGS ?= \
400-
-not -path "*/fixtures/*" \
401-
-not -path "*/snippets/*"
400+
'!' -path "*/fixtures/*" \
401+
'!' -path "*/snippets/*"
402402

403403
# Tools tests directories exclude flags:
404404
FIND_TOOLS_TESTS_DIRS_EXCLUDE_FLAGS ?= \
405-
-not -path "$(TOOLS_DIR)/test" \
406-
-not -path "$(TOOLS_PKGS_DIR)/test" \
407-
-not -path "*/snippets/*" \
408-
-not -path "*/make/lib/*"
405+
'!' -path "$(TOOLS_DIR)/test" \
406+
'!' -path "$(TOOLS_PKGS_DIR)/test" \
407+
'!' -path "*/snippets/*" \
408+
'!' -path "*/make/lib/*"
409409

410410
# Tools tests fixtures exclude flags:
411411
FIND_TOOLS_TESTS_FIXTURES_EXCLUDE_FLAGS ?= \
412-
-not -path "$(TOOLS_DIR)/test" \
413-
-not -path "$(TOOLS_PKGS_DIR)/test" \
414-
-not -path "*/snippets/*" \
415-
-not -path "*/make/lib/*"
412+
'!' -path "$(TOOLS_DIR)/test" \
413+
'!' -path "$(TOOLS_PKGS_DIR)/test" \
414+
'!' -path "*/snippets/*" \
415+
'!' -path "*/make/lib/*"
416416

417417
# On Mac OSX, in order to use `|` and other regular expression operators, we need to use enhanced regular expression syntax (-E); see https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man7/re_format.7.html#//apple_ref/doc/man/7/re_format.
418418
ifeq ($(OS), Darwin)

tools/scripts/find_files

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ main() {
6262

6363
# On Mac OSX, in order to use `|` and other regular expression operators, we need to use enhanced regular expression syntax (-E); see https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man7/re_format.7.html#//apple_ref/doc/man/7/re_format.
6464
if [[ "${kernel}" == "Darwin" ]]; then
65-
files=$(find -E "${root_dir}" -type f -name "${files_pattern}" -regex "${files_filter}" -not -path "${root_dir}/.*" -not -path "${node_modules}/*" -not -path "${build_dir}/*" -not -path "${reports_dir}/*" -not -path "${root_dir}/**/${build_folder}/*")
65+
files=$(find -E "${root_dir}" -type f -name "${files_pattern}" -regex "${files_filter}" '!' -path "${root_dir}/.*" '!' -path "${node_modules}/*" '!' -path "${build_dir}/*" '!' -path "${reports_dir}/*" '!' -path "${root_dir}/**/${build_folder}/*")
6666
else
67-
files=$(find "${root_dir}" -regextype posix-extended -type f -name "${files_pattern}" -regex "${files_filter}" -not -path "${root_dir}/.*" -not -path "${node_modules}/*" -not -path "${build_dir}/*" -not -path "${reports_dir}/*" -not -path "${root_dir}/**/${build_folder}/*")
67+
files=$(find "${root_dir}" -regextype posix-extended -type f -name "${files_pattern}" -regex "${files_filter}" '!' -path "${root_dir}/.*" '!' -path "${node_modules}/*" '!' -path "${build_dir}/*" '!' -path "${reports_dir}/*" '!' -path "${root_dir}/**/${build_folder}/*")
6868
fi
6969
echo "${files}"
7070
}

tools/scripts/find_packages

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ main() {
7272

7373
# On Mac OSX, in order to use `|` and other regular expression operators, we need to use enhanced regular expression syntax (-E); see https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man7/re_format.7.html#//apple_ref/doc/man/7/re_format.
7474
if [[ "${kernel}" == "Darwin" ]]; then
75-
pkgs=$(find -E "${root_dir}" -not -path "${root_dir}/.*" -not -path "${node_modules}/*" -not -path "${tools_dir}/*" -not -path "${tools_pkgs_dir}/*" -not -path "${deps_dir}/*" -not -path "${docs_dir}/*" -not -path "${build_dir}/*" -not -path "${dist_dir}/*" -not -path "${reports_dir}/*" -regex "${packages_filter}" -name "${packages_file}" -exec dirname {} \;)
75+
pkgs=$(find -E "${root_dir}" '!' -path "${root_dir}/.*" '!' -path "${node_modules}/*" '!' -path "${tools_dir}/*" '!' -path "${tools_pkgs_dir}/*" '!' -path "${deps_dir}/*" '!' -path "${docs_dir}/*" '!' -path "${build_dir}/*" '!' -path "${dist_dir}/*" '!' -path "${reports_dir}/*" -regex "${packages_filter}" -name "${packages_file}" -exec dirname {} \;)
7676
else
77-
pkgs=$(find "${root_dir}" -regextype posix-extended -not -path "${root_dir}/.*" -not -path "${node_modules}/*" -not -path "${tools_dir}/*" -not -path "${tools_pkgs_dir}/*" -not -path "${deps_dir}/*" -not -path "${docs_dir}/*" -not -path "${build_dir}/*" -not -path "${dist_dir}/*" -not -path "${reports_dir}/*" -regex "${packages_filter}" -name "${packages_file}" -exec dirname {} \;)
77+
pkgs=$(find "${root_dir}" -regextype posix-extended '!' -path "${root_dir}/.*" '!' -path "${node_modules}/*" '!' -path "${tools_dir}/*" '!' -path "${tools_pkgs_dir}/*" '!' -path "${deps_dir}/*" '!' -path "${docs_dir}/*" '!' -path "${build_dir}/*" '!' -path "${dist_dir}/*" '!' -path "${reports_dir}/*" -regex "${packages_filter}" -name "${packages_file}" -exec dirname {} \;)
7878
fi
7979
echo "${pkgs}"
8080
}

0 commit comments

Comments
 (0)