mirror of
https://github.com/MedzikUser/go-pingbot
synced 2024-08-14 23:57:07 +00:00
chore: nodemon has been replaced by air
This commit is contained in:
parent
6e9a5805d6
commit
15c60fa84a
7 changed files with 39 additions and 42 deletions
32
.air.toml
Normal file
32
.air.toml
Normal 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
6
.gitignore
vendored
|
@ -15,5 +15,7 @@ dist/
|
|||
*.test
|
||||
|
||||
# Configs
|
||||
*.toml*
|
||||
!*schema.toml
|
||||
config.toml
|
||||
|
||||
# Log files
|
||||
air-build-errors.log
|
||||
|
|
5
Makefile
5
Makefile
|
@ -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/
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"watch": ["*"],
|
||||
"ext": "go toml",
|
||||
"signal": "SIGTERM",
|
||||
"quiet": true,
|
||||
"exec": "clear && bash nodemon.sh"
|
||||
}
|
19
nodemon.sh
19
nodemon.sh
|
@ -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
|
|
@ -1,9 +0,0 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
go mod tidy
|
||||
|
||||
# Lint
|
||||
go fmt ./...
|
||||
|
||||
# Add changes
|
||||
git add .
|
3
start.sh
3
start.sh
|
@ -1,5 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#!/bin/bash
|
||||
clear
|
||||
|
||||
# Colors
|
||||
|
|
Loading…
Reference in a new issue