go-kratos / kratos-layout

Kratos Project Template
http://go-kratos.dev
MIT License
402 stars 205 forks source link

Git_Bash in the Makefile is not necessary #116

Closed yrcs closed 1 year ago

yrcs commented 1 year ago

Git_Bash in the Makefile as follows are not necessary! Because if the user is working on Windows, the user needs to install a tool like cygwin64 in order to use the make command, the bash.exe and make.exe must have been added to the Windows environment variable Path. So, simply replace $(Git_Bash) with bash. As shown below:

...
INTERNAL_PROTO_FILES=$(shell bash -c "find internal -name *.proto")
API_PROTO_FILES=$(shell bash -c "find api -name *.proto")
ifeq ($(GOHOSTOS), windows)
    #the `find.exe` is different from `find` in bash/shell.
    #to see https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/find.
    #changed to use git-bash.exe to run find cli or other cli friendly, caused of every developer has a Git.
    Git_Bash= $(subst cmd\,bin\bash.exe,$(dir $(shell where git)))
    INTERNAL_PROTO_FILES=$(shell $(Git_Bash) -c "find internal -name *.proto")
    API_PROTO_FILES=$(shell $(Git_Bash) -c "find api -name *.proto")