-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25c57b8
commit b601c31
Showing
7 changed files
with
95 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'dart:io'; | ||
|
||
List<Directory> findPackages(Directory root, {bool deep = false}) { | ||
final results = <Directory>[]; | ||
|
||
void traverse(Directory dir, {required bool deep}) { | ||
final pubspecs = dir | ||
.listSync() | ||
.whereType<File>() | ||
.where((element) => element.uri.pathSegments.last == 'pubspec.yaml') | ||
.toList(); | ||
|
||
if (pubspecs.isNotEmpty) { | ||
results.add(dir); | ||
} | ||
|
||
if (!pubspecs.isNotEmpty || deep) { | ||
for (var subDir in dir.listSync().whereType<Directory>().where( | ||
(element) => !element.uri.pathSegments | ||
.any((element) => element.startsWith('.')))) { | ||
traverse(subDir, deep: deep); | ||
} | ||
} | ||
} | ||
|
||
traverse(Directory.current, deep: deep); | ||
|
||
return results; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
name: puppy | ||
description: A package for miscellaneous Dart CLI tools. | ||
publish_to: none | ||
|
||
environment: | ||
|