github.com/connorvict/air@v0.0.0-20231005162537-279bf07db0d5/air_example.toml (about)

     1  # Config file for [Air](https://github.com/cosmtrek/air) in TOML format
     2  
     3  # Working directory
     4  # . or absolute path, please note that the directories following must be under root.
     5  root = "."
     6  tmp_dir = "tmp"
     7  
     8  [build]
     9  # Array of commands to run before each build
    10  pre_cmd = ["echo 'hello air' > pre_cmd.txt"]
    11  # Just plain old shell command. You could use `make` as well.
    12  cmd = "go build -o ./tmp/main ."
    13  # Array of commands to run after ^C
    14  post_cmd = ["echo 'hello air' > post_cmd.txt"]
    15  # Binary file yields from `cmd`.
    16  bin = "tmp/main"
    17  # Customize binary, can setup environment variables when run your app.
    18  full_bin = "APP_ENV=dev APP_USER=air ./tmp/main"
    19  # Watch these filename extensions.
    20  include_ext = ["go", "tpl", "tmpl", "html"]
    21  # Ignore these filename extensions or directories.
    22  exclude_dir = ["assets", "tmp", "vendor", "frontend/node_modules"]
    23  # Watch these directories if you specified.
    24  include_dir = []
    25  # Watch these files.
    26  include_file = []
    27  # Exclude files.
    28  exclude_file = []
    29  # Exclude specific regular expressions.
    30  exclude_regex = ["_test\\.go"]
    31  # Exclude unchanged files.
    32  exclude_unchanged = true
    33  # Follow symlink for directories
    34  follow_symlink = true
    35  # This log file places in your tmp_dir.
    36  log = "air.log"
    37  # Poll files for changes instead of using fsnotify.
    38  poll = false
    39  # Poll interval (defaults to the minimum interval of 500ms).
    40  poll_interval = 500 # ms
    41  # It's not necessary to trigger build each time file changes if it's too frequent.
    42  delay = 0 # ms
    43  # Stop running old binary when build errors occur.
    44  stop_on_error = true
    45  # Send Interrupt signal before killing process (windows does not support this feature)
    46  send_interrupt = false
    47  # Delay after sending Interrupt signal
    48  kill_delay = 500 # ms
    49  # Rerun binary or not
    50  rerun = false
    51  # Delay after each executions
    52  rerun_delay = 500
    53  # Add additional arguments when running binary (bin/full_bin). Will run './tmp/main hello world'.
    54  args_bin = ["hello", "world"]
    55  
    56  [log]
    57  # Show log time
    58  time = false
    59  # Only show main log (silences watcher, build, runner)
    60  main_only = false
    61  
    62  [color]
    63  # Customize each part's color. If no color found, use the raw app log.
    64  main = "magenta"
    65  watcher = "cyan"
    66  build = "yellow"
    67  runner = "green"
    68  
    69  [misc]
    70  # Delete tmp directory on exit
    71  clean_on_exit = true
    72  
    73  [screen]
    74  clear_on_rebuild = true
    75  keep_scroll = true