getDartToolVaniaConfigFile function

FutureOr<File?> getDartToolVaniaConfigFile()

Implementation

FutureOr<File?> getDartToolVaniaConfigFile() async {
  try {
    final Directory dartToolDir =
        Directory('${Directory.current.path}/.dart_tool');
    if (dartToolDir.existsSync()) {
      final configFile =
          File(path.join(dartToolDir.path, Constants.vaniaConfigFile));
      if (configFile.existsSync()) {
        return configFile;
      } else {
        await configFile.create(recursive: true);
        return configFile;
      }
    }
  } catch (_) {}

  return null;
}