wails/v2/pkg/templates
Lea Anthony 718fd92f85
fix(v2): prevent wails init in non-empty directory with -d flag (#4955)
* fix(v2): prevent wails init in non-empty directory with -d flag

When using -d to specify a target directory, wails init now checks if
the directory is non-empty and errors if so. This prevents accidental
data loss (e.g., overwriting .git directories).

Fixes #4940

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(v2): add tests for init non-empty directory check

Add tests to verify:
- Install fails when target directory is non-empty
- Install succeeds when target directory is empty

Also update changelog with the fix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-02-04 21:23:07 +11:00
..
base Fix up templates to correct go version (1.23.0) (#4618) 2026-01-25 11:16:42 +11:00
generate fix: add missing EventsOffAll export to runtime templates (#4883) 2026-01-25 13:10:24 +11:00
ides Releasetest/release workflow (#1869) 2022-09-18 08:55:21 +10:00
templates fix: add missing EventsOffAll export to runtime templates (#4883) 2026-01-25 13:10:24 +11:00
templates.go fix(v2): prevent wails init in non-empty directory with -d flag (#4955) 2026-02-04 21:23:07 +11:00
templates_test.go fix(v2): prevent wails init in non-empty directory with -d flag (#4955) 2026-02-04 21:23:07 +11:00