copyPubspecFile method

bool copyPubspecFile(
  1. File source,
  2. File destination
)

Implementation

bool copyPubspecFile(File source, File destination) {
  if (!source.existsSync()) {
    print('❌ Template pubspec.yaml not found: ${source.path}');
    return false;
  }

  try {
    destination.writeAsBytesSync(source.readAsBytesSync());
    print('✅  Updated: pubspec.yaml');
    return true;
  } catch (e) {
    print('❌ Failed to write pubspec.yaml: $e');
    return false;
  }
}