delete function
Implementation
void delete(String path) {
if (!exists(path)) {
StatusHelper.failed('The path ${truepath(path)} does not exists.');
}
if (isDirectory(path)) {
StatusHelper.failed('The path ${truepath(path)} is a directory.');
}
try {
File(path).deleteSync();
} catch (e) {
StatusHelper.failed(
'An error occured deleting ${truepath(path)}. Error: $e');
}
}