Skip to content

Commit 149aa11

Browse files
authored
Merge pull request #2692 from norio-nomura/stop-using-globstar
Makefile: use `find` instead of `bash -c -O globstar ...`
2 parents 9a17438 + 53b1dc6 commit 149aa11

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ limactl: _output/bin/limactl$(exe) lima
156156

157157
### Listing Dependencies
158158

159-
# returns a list of files expanded from $(1) excluding directories.
160-
glob_excluding_dir = $(shell bash -c -O extglob -O globstar -O nullglob 'for f in $(1); do test -d $$f || echo $$f; done')
161-
FILES_IN_PKG = $(call glob_excluding_dir, ./pkg/**/!(*_test.go))
159+
# returns a list of files expanded from $(1) excluding directories and files ending with '_test.go'.
160+
find_files_excluding_dir_and_test = $(shell find $(1) ! -type d ! -name '*_test.go')
161+
FILES_IN_PKG = $(call find_files_excluding_dir_and_test, ./pkg)
162162

163163
# returns a list of files which are dependencies for the command $(1).
164-
dependencis_for_cmd = go.mod $(call glob_excluding_dir, ./cmd/$(1)/**/!(*_test.go)) $(FILES_IN_PKG)
164+
dependencis_for_cmd = go.mod $(call find_files_excluding_dir_and_test, ./cmd/$(1)) $(FILES_IN_PKG)
165165

166166
### Force Building Targets
167167

0 commit comments

Comments
 (0)