search method

void search(
  1. String projectPath
)

搜索pubspec以及images檔案

Implementation

void search(String projectPath) {
  pubspecYamlPath = join(projectPath, 'pubspec.yaml');
  imagesDartPath = join(projectPath, 'lib', 'r', 'r_part.dart');

  if (!File(pubspecYamlPath!).existsSync()) {
    print('沒有在以下路徑找到pubspec.yaml(將忽略套用): $pubspecYamlPath');
    pubspecYamlPath = null;
  }

  if (!File(imagesDartPath!).existsSync()) {
    print('沒有在以下路徑找到images.dart(將忽略套用): $imagesDartPath');
    imagesDartPath = null;
  }
}