writeFile static method
Implementation
static Future<bool>? writeFile({
required String pathFile,
required String content,
bool isCreateNew = false,
}) async {
final runBash = File(pathFile);
final runBashExists = await runBash.exists();
if (!runBashExists) {
runBash.createSync();
} else if (isCreateNew) {
runBash.deleteSync();
runBash.createSync();
}
await runBash.writeAsString(content);
return runBash.path.isNotEmpty;
}