Skip to content

Commit ac4f952

Browse files
Fix make find command (#10580)
Continuation of #10577 This version also includes an additional fix for Darwin and FreeBSD which do not accept the `-regextype` option, but only `-E` and the argument order is specifically required like this for `-E` to work. Co-authored-by: guillep2k <[email protected]>
1 parent 5e1438b commit ac4f952

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ endif
1616

1717
ifeq ($(OS), Windows_NT)
1818
EXECUTABLE ?= gitea.exe
19+
FIND_PWD_REGEXP := find . -regextype posix-egrep
1920
else
2021
EXECUTABLE ?= gitea
2122
UNAME_S := $(shell uname -s)
23+
FIND_PWD_REGEXP := find . -regextype posix-egrep
2224
ifeq ($(UNAME_S),Darwin)
2325
SED_INPLACE := sed -i ''
26+
FIND_PWD_REGEXP := find -E .
2427
endif
2528
ifeq ($(UNAME_S),FreeBSD)
2629
SED_INPLACE := sed -i ''
30+
FIND_PWD_REGEXP := find -E .
2731
endif
2832
endif
2933

@@ -63,7 +67,7 @@ LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(G
6367

6468
PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell GO111MODULE=on $(GO) list -mod=vendor ./... | grep -v /vendor/)))
6569

66-
GO_SOURCES ?= $(shell find . -type d \( -path ./node_modules -o -path ./docs -o -path ./public -o -path ./options -o -path ./contrib -o -path ./data \) -prune -o -type f -name '*.go' -print)
70+
GO_SOURCES ?= $(shell $(FIND_PWD_REGEXP) -regex '\./(node_modules|docs|public|options|contrib|data)' -prune -o -name "*.go" -type f -print)
6771
GO_SOURCES_OWN := $(filter-out ./vendor/% %/bindata.go, $(GO_SOURCES))
6872

6973
WEBPACK_SOURCES ?= $(shell find web_src/js web_src/less -type f)

0 commit comments

Comments
 (0)