Skip to content

Commit 93e8135

Browse files
Dillon Nysdnys1
authored andcommitted
chore(infra): Fix create_configs script
Broken after `aft.yaml` refactor
1 parent c17d378 commit 93e8135

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

infra/tool/create_configs.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ const exampleApps = {
2525

2626
late final Directory repoRoot = () {
2727
Directory dir = Directory.current;
28+
Directory? rootDir;
2829
while (p.absolute(dir.parent.path) != p.absolute(dir.path)) {
2930
final files = dir.listSync().whereType<File>();
30-
if (files.any((f) => p.basename(f.path) == 'aft.yaml')) {
31-
return dir;
31+
if (files.any((f) => p.basename(f.path) == 'pubspec.yaml')) {
32+
rootDir = dir;
3233
}
3334
dir = dir.parent;
3435
}
35-
throw StateError('Could not locate repo root');
36+
if (rootDir == null) {
37+
throw StateError('Could not locate repo root');
38+
}
39+
return rootDir;
3640
}();
3741

3842
void main() {

0 commit comments

Comments
 (0)