Skip to content

Instantly share code, notes, and snippets.

@GroovinChip
Created October 17, 2022 16:58
Show Gist options
  • Save GroovinChip/b54d3e944cd8c15f655c5e233eff1252 to your computer and use it in GitHub Desktop.
Save GroovinChip/b54d3e944cd8c15f655c5e233eff1252 to your computer and use it in GitHub Desktop.
Bash commands for listing & totalling all generated Dart files

Get counts of generated files

$ find . -type f -name "*.FILE_TYPE.dart" -exec printf x \; | wc -c

Where FILE_TYPE is the generated file type, such as g or freezed.

Ignoring test directories

$ find . -type f -name "*.FILE_TYPE.dart" -not -path "*/test/*" -exec printf x \; | wc -c

List all generated files and copy to clipboard

$ find . -name "*.FILE_TYPE.dart" -type f | pbcopy

Where FILE_TYPE is the generated file type, such as g or freezed.

Ignoring test directories

$ find . -name "*.FILE_TYPE.dart" -not -path "*/test/*" -type f | pbcopy

Sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment