cliGenerateCopierProject function

Future<void> cliGenerateCopierProject(
  1. String projectPath,
  2. String studyTitle,
  3. List<String> outcomes,
  4. String gitUrl,
)

Implementation

Future<void> cliGenerateCopierProject(
  String projectPath,
  String studyTitle,
  List<String> outcomes,
  String gitUrl,
) async {
  const copierBin = 'copier';
  const copierTemplate = 'gh:hpi-studyu/copier-studyu';
  try {
    File(projectPath).deleteSync(recursive: true);
  } catch (e) {
    print(e);
  }
  await runCliProcess(copierBin, [
    copierTemplate,
    projectPath,
    '--force',
    '--data',
    'study_title=$studyTitle',
    '--data',
    'outcomes=${jsonEncode(outcomes)}',
    '--data',
    'git_url=$gitUrl'
  ]);
}