diff --git a/.air.toml b/.air.toml new file mode 100644 index 0000000..f837929 --- /dev/null +++ b/.air.toml @@ -0,0 +1,51 @@ +root = "." +testdata_dir = "testdata" +tmp_dir = "build" + +[build] + args_bin = [] + bin = "./build/discord-service" + cmd = "go build -o build/discord-service main.go" + delay = 1000 + exclude_dir = ["assets", "tmp", "vendor", "testdata", "bin", "build"] + exclude_file = [] + exclude_regex = ["_test.go"] + exclude_unchanged = false + follow_symlink = false + full_bin = "" + include_dir = [] + include_ext = ["go", "tpl", "tmpl", "html"] + include_file = [] + kill_delay = "0s" + log = "build-errors.log" + poll = false + poll_interval = 0 + post_cmd = [] + pre_cmd = [] + rerun = false + rerun_delay = 500 + send_interrupt = false + stop_on_error = false + +[color] + app = "" + build = "yellow" + main = "magenta" + runner = "green" + watcher = "cyan" + +[log] + main_only = false + time = false + +[misc] + clean_on_exit = false + +[proxy] + app_port = 0 + enabled = false + proxy_port = 0 + +[screen] + clear_on_rebuild = false + keep_scroll = true diff --git a/.gitignore b/.gitignore index a245baa..b4c5b71 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .vscode coverage.html coverage.out -build \ No newline at end of file +tmp +build diff --git a/Makefile b/Makefile index 0a8cee4..263fdef 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,12 @@ -air: +dev: @echo "Running the Go project using Air..." - air - -run: + @air +build: + @echo "Building the Go Project...." + @go build -o build/discord-service +run:build @echo "Running the Go project..." - go run . + @./build/discord-service ngrok: @echo "Running the Go project using Ngrok..." diff --git a/README.md b/README.md index 4d21c96..d551437 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This document provides instructions on how to set up and run the Go project usin - Go 1.18+ - Make -- Air (for `make air`) +- Air (for `make dev`) - Ngrok (for `make ngrok`) Ensure you have these dependencies installed before running the commands. @@ -89,7 +89,7 @@ You can run the project using the `Makefile`, which provides several commands fo 4. **Running the Project Using Air** ```bash - make air + make dev ``` ## Run the Project Using Docker @@ -128,7 +128,7 @@ You can run the project using the `Docker`, using the following steps 3. **To automatically re-run the application on changes**: ```bash - make air #or air + make dev #or air ``` 4. **To clean up the generated files**: