Skip to content

Instantly share code, notes, and snippets.

@maxme
Created November 6, 2020 15:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxme/1fb6ce5ad83e7acaa4880593b95bae00 to your computer and use it in GitHub Desktop.
Save maxme/1fb6ce5ad83e7acaa4880593b95bae00 to your computer and use it in GitHub Desktop.
ls-gutenblocks.sh
#!/bin/zsh
# History https://github.com/WordPress/gutenberg/commits/master/packages/block-library/src/index.native.js
# gb-mobile Jetpack blocks: https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/src/jetpack-editor-setup.js
if [[ $# -eq 0 ]] ; then
BRANCH=master
else
BRANCH=$1
fi
URL=https://raw.githubusercontent.com/WordPress/gutenberg/$BRANCH/packages/block-library/src/index.native.js
URL_JETPACK=https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/develop/src/jetpack-editor-setup.js
TAB=" "
curl -s $URL | grep registerCoreBlocks -A 100 | grep "$TAB$TAB" | sed "s/,//g" | sed "s/$TAB$TAB//" | grep -v "missing" | grep -v setGrou | sort | tee /tmp/yo; echo -n "### Total: "; cat /tmp/yo | wc -l; echo -n "### Total without devOnly: "; cat /tmp/yo | grep -v devOnly | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment