(folder?: string)
| 221 | } |
| 222 | |
| 223 | export function projectReferencesFlutter(folder?: string): boolean { |
| 224 | if (folder && hasPubspec(folder)) { |
| 225 | const pubspecPath = path.join(folder, "pubspec.yaml"); |
| 226 | try { |
| 227 | const pubspecContent = fs.readFileSync(pubspecPath); |
| 228 | return pubspecContentReferencesFlutter(pubspecContent.toString()); |
| 229 | } catch (e: any) { |
| 230 | if (e?.code !== "ENOENT") // Don't warn for missing files. |
| 231 | console.warn(`Failed to read ${pubspecPath}: ${e}`); |
| 232 | } |
| 233 | } |
| 234 | return false; |
| 235 | } |
| 236 | |
| 237 | export function pubspecContentReferencesFlutter(content: string): boolean { |
| 238 | // Do a fast string check first, because YAML parse can be slow in comparison. |
no test coverage detected