write method
Write a file to the specified path. Returns true if file was written, false if skipped.
Implementation
bool write(String relativePath, String content) {
final fullPath = '$basePath/$relativePath';
final file = File(fullPath);
// Check if file exists and we're not forcing
if (file.existsSync() && !force) {
Console.fileSkipped(relativePath);
return false;
}
// Create directory if needed
final dir = file.parent;
if (!dir.existsSync()) {
dir.createSync(recursive: true);
}
// Write the file
file.writeAsStringSync(content);
return true;
}