Commit Graph

2 Commits

Author SHA1 Message Date
Tonis Tiigi
304b6ecedc ops: improve error messages from fileop
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-07-22 15:14:05 -07:00
Jakub Ciolek
ce439567a4 file: Fix incorrect handling of non-existent files in llbsolver's rmPath
The os.RemoveAll() call returns nil if the path doesn't exist. When the
rmPath function is called with allowNotFound set to false, it doesn't change the
behaviour of the function.

Change the code so if allowNotFound is set to false, we first check
whether the file exists. If it doesn't exist, return an error.

Add tests for three relevant cases.

Signed-off-by: Jakub Ciolek <jakub@ciolek.dev>
2023-07-23 15:28:09 +02:00