Compare commits

..

No commits in common. "4877f72f043cf7c910b969ea39226b8535a8d342" and "c0daf06ee6eb3330f84cbc409b6ca046cfb2de6d" have entirely different histories.

2 changed files with 6 additions and 5 deletions

View File

@ -13,7 +13,8 @@ test-coverage:
mkdir ${COVERAGE_DIR} mkdir ${COVERAGE_DIR}
go test -v -coverprofile ${COVERAGE_DIR}/cover.out ./... go test -v -coverprofile ${COVERAGE_DIR}/cover.out ./...
go tool cover -html ${COVERAGE_DIR}/cover.out -o ${COVERAGE_DIR}/cover.html go tool cover -html ${COVERAGE_DIR}/cover.out -o ${COVERAGE_DIR}/cover.html
cd ${COVERAGE_DIR}
open cover.html
build: build:
rm -rf ${BINARY_DIR}
mkdir ${BINARY_DIR} mkdir ${BINARY_DIR}
env GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -o ./${BINARY_DIR}/${BINARY_NAME} main.go go build -o ${BINARY_DIR}/${BINARY_NAME}

View File

@ -13,10 +13,10 @@ type Config struct {
ScriptBinaryPath string `required:"true" split_words:"true"` ScriptBinaryPath string `required:"true" split_words:"true"`
WebhookScriptPath string `required:"true" split_words:"true"` WebhookScriptPath string `required:"true" split_words:"true"`
FileToWatchPath string `required:"true" split_words:"true"` FileToWatchPath string `required:"true" split_words:"true"`
TestFileToWatchPath string `required:"false" split_words:"true"` TestFileToWatchPath string `required:"true" split_words:"true"`
} }
func RootDir() string { func rootDir() string {
cmdOut, err := exec.Command("git", "rev-parse", "--show-toplevel").Output() cmdOut, err := exec.Command("git", "rev-parse", "--show-toplevel").Output()
if err != nil { if err != nil {
log.Fatalf("exec.Command: %s", err) log.Fatalf("exec.Command: %s", err)
@ -29,7 +29,7 @@ func RootDir() string {
func NewConfig(isProd bool) *Config { func NewConfig(isProd bool) *Config {
if !isProd { if !isProd {
err := godotenv.Load(RootDir() + "/.env") err := godotenv.Load(rootDir() + "/.env")
if err != nil { if err != nil {
log.Fatalf("environment variable ENV is empty and an error occurred while loading the .env file\n") log.Fatalf("environment variable ENV is empty and an error occurred while loading the .env file\n")
} }