copyTemplate static method

Future<void> copyTemplate(
  1. ProjectConfig config
)

Copy template files to create a new project

Implementation

static Future<void> copyTemplate(ProjectConfig config) async {
  final templatePath = await _getTemplatePath();
  final targetPath = path.join(Directory.current.path, config.projectDirectoryName);

  // Create target directory
  final targetDir = Directory(targetPath);
  if (await targetDir.exists()) {
    throw Exception('Directory ${config.projectDirectoryName} already exists');
  }

  await targetDir.create(recursive: true);

  // Copy template files
  await _copyDirectory(templatePath, targetPath);

  // Process platform-specific files
  await _processPlatformFiles(config, targetPath);
}