5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 05:50:08 +08:00

continueOnError for RemoveFiles

Allow the purge to continue even if one of the files fails to be removed.
This commit is contained in:
Travis McLane 2020-04-05 12:15:39 -05:00 committed by Lea Anthony
parent 6e29d1b087
commit a78acbb247

View File

@ -117,10 +117,10 @@ func (fs *FSHelper) RemoveFile(filename string) error {
}
// RemoveFiles removes the given filenames
func (fs *FSHelper) RemoveFiles(files []string) error {
func (fs *FSHelper) RemoveFiles(files []string, continueOnError bool) error {
for _, filename := range files {
err := os.Remove(filename)
if err != nil {
if err != nil && !continueOnError {
return err
}
}