readTemplete method

String readTemplete(
  1. String group,
  2. String file,
  3. String template,
  4. String path,
)

Implementation

String readTemplete(
  String group,
  String file,
  String template,
  String path,
) {
  var root = '.ft_cli';

  path = '$group/$path';

  var existFile = File('$root/$path/$file').existsSync();

  if (!existFile) {
    DirectoryUtils.create('$root/$path');
    File('$root/$path/$file').writeAsStringSync(template);
  }

  return File('$root/$path/$file').readAsStringSync();
}