fix: clean up empty file after failed wl-paste clipboard extraction
When wl-paste produces empty output, the destination file was left on disk as a 0-byte orphan. Now explicitly removed before returning False.
This commit is contained in:
@@ -254,6 +254,7 @@ def _wayland_save(dest: Path) -> bool:
|
||||
)
|
||||
|
||||
if not dest.exists() or dest.stat().st_size == 0:
|
||||
dest.unlink(missing_ok=True)
|
||||
return False
|
||||
|
||||
# BMP needs conversion to PNG (common in WSLg where only BMP
|
||||
|
||||
Reference in New Issue
Block a user