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:
Treaser(Song) Lou 2020-12-08 16:12:28 +08:00 committed by GitHub
commit bee353617f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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"