air icon indicating copy to clipboard operation
air copied to clipboard

Warn if tmp dir is the current working directory

Open drshrey opened this issue 4 years ago • 2 comments

In .air.conf, if you set the tmp to ".", your entire current working directory will be wiped. This can be very bad especially if you haven't committed to git in a while. Can we have a warning if it is set to "." or atleast some documentation around that please?

My .air.conf that caused this:

# 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 = "."

[build]
# Just plain old shell command. You could use `make` as well.
cmd = "go build"
# Binary file yields from `cmd`.
bin = "main"

drshrey avatar Dec 24 '19 23:12 drshrey

Thanks for your advice, it does make sense, I'll update the README.

cosmtrek avatar Jan 04 '20 05:01 cosmtrek

Maybe show it like this? https://github.com/cosmtrek/air/pull/64

musinit avatar Apr 16 '20 11:04 musinit