cmd/cli: make --cleanup removing more files

While at it, also implementing self-delete function for Windows.
This commit is contained in:
Cuong Manh Le
2024-07-24 18:35:34 +07:00
committed by Cuong Manh Le
parent 72bf80533e
commit 04947b4d87
5 changed files with 169 additions and 5 deletions
+3 -1
View File
@@ -797,7 +797,9 @@ func withEachPhysicalInterfaces(excludeIfaceName, context string, f func(i *net.
}
// TODO: investigate whether we should report this error?
if err := f(netIface); err == nil {
mainLog.Load().Debug().Msgf("%s for interface %q successfully", context, i.Name)
if context != "" {
mainLog.Load().Debug().Msgf("%s for interface %q successfully", context, i.Name)
}
} else if !errors.Is(err, errSaveCurrentStaticDNSNotSupported) {
mainLog.Load().Err(err).Msgf("%s for interface %q failed", context, i.Name)
}