Comments (5)
make sure go build out with ext .exe and run the execute file with ext .exe :)
this is a example 👍
# Config file for [Air](https://github.com/cosmtrek/air) in TOML format # Working directory # . or absolute path, please note that the directories following must be under root root = "." # Optional! If `watch_dir` is empty, use `root`. watch_dir = "" tmp_dir = "tmp" [build] # Just plain old shell command. You could use `make` as well. cmd = "go build -o ./tmp/main.exe main.go" # Binary file yields from `cmd`. bin = "tmp/main.exe" # Customize binary. full_bin = "tmp/main.exe" # This log file places in your tmp_dir. log = "air_errors.log" # Watch these filename extensions. include_ext = ["go", "tpl", "tmpl", "html"] # Ignore these filename extensions or directories. exclude_dir = ["docs","assets", "tmp", "vendor", "frontend/node_modules"] # It's not necessary to trigger build each time file changes if it's too frequent. delay = 1000 # ms [log] # Show log time time = false [color] # Customize each part's color. If no color found, use the raw app log. main = "magenta" watcher = "cyan" build = "yellow" runner = "green" [misc] # Delete tmp directory on exit clean_on_exit = true
thanks !!
I solved The problem by add "start" on full_bin's head
full_bin = "start ./cmd/server/server -c ./configs/config.toml -m ./configs/model.conf -swagger ./docs/swagger -menu ./configs/menu.json"
from air.
Do you run air
on Windows?
from air.
make sure go build out with ext .exe and run the execute file with ext .exe :)
this is a example 👍
# Config file for [Air](https://github.com/cosmtrek/air) in TOML format
# Working directory
# . or absolute path, please note that the directories following must be under root
root = "."
# Optional! If `watch_dir` is empty, use `root`.
watch_dir = ""
tmp_dir = "tmp"
[build]
# Just plain old shell command. You could use `make` as well.
cmd = "go build -o ./tmp/main.exe main.go"
# Binary file yields from `cmd`.
bin = "tmp/main.exe"
# Customize binary.
full_bin = "tmp/main.exe"
# This log file places in your tmp_dir.
log = "air_errors.log"
# Watch these filename extensions.
include_ext = ["go", "tpl", "tmpl", "html"]
# Ignore these filename extensions or directories.
exclude_dir = ["docs","assets", "tmp", "vendor", "frontend/node_modules"]
# It's not necessary to trigger build each time file changes if it's too frequent.
delay = 1000 # ms
[log]
# Show log time
time = false
[color]
# Customize each part's color. If no color found, use the raw app log.
main = "magenta"
watcher = "cyan"
build = "yellow"
runner = "green"
[misc]
# Delete tmp directory on exit
clean_on_exit = true
from air.
Do you run
air
on Windows?
yes
from air.
change
full_bin = "./cmd/server/server -c ./configs/config.toml -m ./configs/model.conf -swagger ./docs/swagger -menu ./configs/menu.json"
to
full_bin = "start ./cmd/server/server -c ./configs/config.toml -m ./configs/model.conf -swagger ./docs/swagger -menu ./configs/menu.json"
can fix the problem
from air.
Related Issues (20)
- TODOs HOT 1
- send_interrupt not working on Linux
- Add `-p` flag to `mkdir`, when creating temp folder HOT 1
- Parse errors in .air.toml cause it to be silently ignored HOT 1
- Files in `root_dir` not watched properly when using `include_dir`
- Support for watching `.hidden` directories
- Debugger is stopped whenever change is made.
- version "go1.21.4" does not match go tool version "go1.21.3" HOT 1
- cmd 命令双引号问题 HOT 3
- Weird character during running phase HOT 1
- [Question] How to prevent running web server when failed to compile? HOT 2
- Docker Container failed to remove app/tmp/main server, error: remove app/tmp/main: not a directory
- tmp directory is always created in project root
- exclude subdirectory not work on windows HOT 1
- 希望可以增加配置文件变更,也可以 reload
- air doesnt reloading in the deeper path HOT 12
- Air not starting on windows 11 HOT 1
- [Question]: how go install command populating version.go file variables
- ".air.toml" fails to parse and air proceeds silently
- Provide SSH Key for build command in .air.toml
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from air.