chore: nodemon has been replaced by air

This commit is contained in:
Medzik 2021-11-13 12:51:38 +00:00
parent 6e9a5805d6
commit 15c60fa84a
7 changed files with 39 additions and 42 deletions

32
.air.toml Normal file
View File

@ -0,0 +1,32 @@
root = "."
tmp_dir = "tmp"
[build]
bin = "./tmp/pingbot"
cmd = "make build BINARY_OUT=./tmp/pingbot"
delay = 1000
exclude_dir = ["tmp"]
exclude_file = []
exclude_regex = []
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "toml"]
kill_delay = "0s"
log = "air-build-errors.log"
send_interrupt = false
stop_on_error = true
[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"
[log]
time = false
[misc]
clean_on_exit = true

6
.gitignore vendored
View File

@ -15,5 +15,7 @@ dist/
*.test
# Configs
*.toml*
!*schema.toml
config.toml
# Log files
air-build-errors.log

View File

@ -1,4 +1,4 @@
BINARY_NAME := pingbot.out
BINARY_OUT := pingbot.out
# executables
GO := go
@ -9,11 +9,10 @@ BUILD_FLAGS :=
build:
$(GO) mod tidy
$(GO) build ${BUILD_FLAGS} -o ${BINARY_NAME} ./cmd/pingbot
$(GO) build ${BUILD_FLAGS} -o ${BINARY_OUT} ./cmd/pingbot
snapshot:
$(GORELEASER) --snapshot --rm-dist
clean:
$(GO) clean
rm -rf pingbot* dist/

View File

@ -1,7 +0,0 @@
{
"watch": ["*"],
"ext": "go toml",
"signal": "SIGTERM",
"quiet": true,
"exec": "clear && bash nodemon.sh"
}

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
# Colors
green="\e[0;92m"
red="\e[0;91m"
nc="\e[0m" # No Color
printf "${nc}[${green}Start${nc}]\n"
if ! go build -o pingbot.out; then
printf "${nc}[${red}COMPILE ERROR${nc}]\n"
exit 1
else
if ! ./pingbot.out; then
printf "${nc}[${red}PROGRAM PANIC${nc}]\n"
exit 1
else
printf "${nc}[${red}PROGRAM END${nc}]\n"
fi
fi

View File

@ -1,9 +0,0 @@
#!/usr/bin/bash
go mod tidy
# Lint
go fmt ./...
# Add changes
git add .

View File

@ -1,5 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
clear
# Colors