Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable tmp directory #580

Open
Auxority opened this issue May 7, 2024 · 3 comments
Open

Disable tmp directory #580

Auxority opened this issue May 7, 2024 · 3 comments

Comments

@Auxority
Copy link

Auxority commented May 7, 2024

Hey, first of all I want to thank you guys for creating this amazing tool.

I'd like to disable the creation of the tmp directory. But I cannot find any way to do this.
I managed to disable the creation of any files inside the directory, but the directory itself is still created.
This is my .air.toml file, I run it inside a Docker container using a development stage:

root = "/app"
tmp_dir = "tmp"

[build]
  args_bin = []
  bin = "/go/bin/app"
  cmd = "go build -o /go/bin/app ."
  delay = 1000
  exclude_dir = ["tmp"]
  exclude_file = []
  exclude_regex = ["_test.go"]
  exclude_unchanged = false
  follow_symlink = false
  full_bin = ""
  include_dir = []
  include_ext = ["go"]
  include_file = []
  kill_delay = "0s"
  log = "/dev/null"
  poll = true
  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 = true
  time = false

[misc]
  clean_on_exit = true

[screen]
  clear_on_rebuild = false
  keep_scroll = true
@MaxThom
Copy link

MaxThom commented May 24, 2024

+1 for this! There is always an empty tmp directory even if not used. I tried settings tmp_dir="", but still created a tmp folder.

@chrisk314
Copy link

chrisk314 commented Jun 21, 2024

I'd also like to get rid of this tmp directory. I'd rather have the build log files placed in the root directory. I tried tmp = "./" and tmp = ".", but both of those resulted in the tmp directory created under root. This is surprising as it contradicts with the statement that all directories are relative to root, which implies that "." and "./" should refer to the same directory as root, given that tmp and ./tmp result in ${root}/tmp.

@MaxThom
Copy link

MaxThom commented Jun 22, 2024

I'm sharing what I end up doing for my setup. In my project I got many services that are all under the cmds/ folder. I also didnt like having an air file next to the main file so I created a air directory that contains the air files and the air tmp directories.

structure

/root
  .air/
     core/
     twin/
     core.toml
     twin.toml
     ...
  bin/
    core
    twin
  cmds/
    core/
      main.go
    twin/
      main.go

core.toml

root = "../"
testdata_dir = "testdata"
tmp_dir = "core"

[build]
args_bin = []
bin = "bin/core"
cmd = "go build -o ./bin/core ./cmds/core"

im simply starting my apps using air -c .air/core.toml at the root level. I also use a makefile for ease.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants