From 15c60fa84a3d2a5cc58dee3ba1f978f9c1f7c71d Mon Sep 17 00:00:00 2001 From: Medzik Date: Sat, 13 Nov 2021 12:51:38 +0000 Subject: [PATCH] chore: nodemon has been replaced by air --- .air.toml | 32 ++++++++++++++++++++++++++++++++ .gitignore | 6 ++++-- Makefile | 5 ++--- nodemon.json | 7 ------- nodemon.sh | 19 ------------------- pre-commit.sh | 9 --------- start.sh | 3 +-- 7 files changed, 39 insertions(+), 42 deletions(-) create mode 100644 .air.toml delete mode 100644 nodemon.json delete mode 100755 nodemon.sh delete mode 100755 pre-commit.sh diff --git a/.air.toml b/.air.toml new file mode 100644 index 0000000..ddf5c31 --- /dev/null +++ b/.air.toml @@ -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 diff --git a/.gitignore b/.gitignore index 8230978..a53303b 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,7 @@ dist/ *.test # Configs -*.toml* -!*schema.toml +config.toml + +# Log files +air-build-errors.log diff --git a/Makefile b/Makefile index f145144..9429379 100644 --- a/Makefile +++ b/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/ diff --git a/nodemon.json b/nodemon.json deleted file mode 100644 index 2c94505..0000000 --- a/nodemon.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "watch": ["*"], - "ext": "go toml", - "signal": "SIGTERM", - "quiet": true, - "exec": "clear && bash nodemon.sh" -} diff --git a/nodemon.sh b/nodemon.sh deleted file mode 100755 index 480841d..0000000 --- a/nodemon.sh +++ /dev/null @@ -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 diff --git a/pre-commit.sh b/pre-commit.sh deleted file mode 100755 index 98990ab..0000000 --- a/pre-commit.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/bash - -go mod tidy - -# Lint -go fmt ./... - -# Add changes -git add . diff --git a/start.sh b/start.sh index 40d05c6..6d4a7a2 100755 --- a/start.sh +++ b/start.sh @@ -1,5 +1,4 @@ -#!/usr/bin/env bash - +#!/bin/bash clear # Colors