Merge pull request #277 from meshplus/fix/fix-makefile
fix(makefile): fix replace newline can't work for some sed
This commit is contained in:
commit
bee353617f
6
Makefile
6
Makefile
|
@ -23,7 +23,7 @@ GREEN=\033[0;32m
|
|||
BLUE=\033[0;34m
|
||||
NC=\033[0m
|
||||
|
||||
MODS = $(shell sed -e ':a' -e 'N' -e '$$!ba' -e 's/\n/\\n/g' goent.diff)
|
||||
MODS = $(shell sed -e ':a' -e 'N' -e '$$!ba' -e 's/\n/@/g' goent.diff)
|
||||
|
||||
help: Makefile
|
||||
@printf "${BLUE}Choose a command run:${NC}\n"
|
||||
|
@ -66,7 +66,7 @@ build:
|
|||
installent:
|
||||
cd internal/repo && packr
|
||||
cp imports/imports.go.template imports/imports.go
|
||||
@sed "s?)?$(MODS)\n)?" go.mod > goent.mod
|
||||
@sed "s?)?$(MODS)@)?" go.mod | tr '@' '\n' > goent.mod
|
||||
$(GO) install -tags ent -ldflags '${GOLDFLAGS}' -modfile goent.mod ./cmd/${APP_NAME}
|
||||
@printf "${GREEN}Install bitxhub ent successfully!${NC}\n"
|
||||
|
||||
|
@ -74,7 +74,7 @@ buildent:
|
|||
cd internal/repo && packr
|
||||
@mkdir -p bin
|
||||
cp imports/imports.go.template imports/imports.go
|
||||
@sed "s?)?$(MODS)\n)?" go.mod > goent.mod
|
||||
@sed "s?)?$(MODS)@)?" go.mod | tr '@' '\n' > goent.mod
|
||||
$(GO) build -tags ent -ldflags '${GOLDFLAGS}' -modfile goent.mod ./cmd/${APP_NAME}
|
||||
@mv ./bitxhub bin
|
||||
@printf "${GREEN}Build bitxhub ent successfully!${NC}\n"
|
||||
|
|
Loading…
Reference in New Issue