air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
16.35k stars 771 forks source link

Support creating parent directories as needed #518

Open mcieno opened 5 months ago

mcieno commented 5 months ago

I oftentimes find myself needing a multilevel folder structure in the tmp folder (e.g., tmp/cmd1/..., tmp/cmd2/...).

Unfortunately, tmp_dir = tmp/cmd1 fails unless tmp/ already exists. Although this is very easy to work around by creating the parent directories beforehand, I believe that Air should be able to recursively create parents by default.

This change is equivalent to running mkdir -p "$tmp_dir" instead of mkdir "$tmp_dir".