Created
January 9, 2021 17:46
-
-
Save freitzzz/18184bd94258e748e8d1565cb6d08176 to your computer and use it in GitHub Desktop.
[one-liner] Flutter get packages in all packages of a project
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
File('.').listSync(recursive: true).whereType<File>().where((f) => f.path.endsWith('pubspec.yaml')).where((f) => !f.path.contains('ios/.symlinks')).map((f) => f.parent).map((d) => Process.runSync('flutter', ['pub', 'get'], workingDirectory: d.absolute.path)).forEach((x) => print(x.stdout)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is required as on iOS build, a .symlinks folder is created, pointing to packages used on the project
Usage of runSync is required as Flutter command is not multithreaded (blocks upon usage)