| #!/bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| indent() { sed 's/^/ /'; }
|
| indent_more() { sed 's/^/\t/'; }
|
| empty_lines() { printf '\n\n'; }
|
|
|
|
|
| empty_lines
|
| echo Cleaning up a merge from Blockly to Scratch-Blocks...
|
|
|
|
|
|
|
| empty_lines
|
| echo Cleaning up Blockly message files...
|
|
|
| shopt -s extglob
|
|
|
|
|
| cd msg/json
|
| git rm -f !(en.json|synonyms.json) | indent_more
|
| cd ../..
|
|
|
|
|
| cd msg/js
|
| git rm -f !(en.js) | indent_more
|
| cd ../..
|
|
|
|
|
| shopt -u extglob
|
|
|
|
|
| empty_lines
|
| echo Removing blockly-specific directories...
|
| dirslist="accessible demos tests/generators appengine blocks local_build"
|
| for directory in $dirslist
|
| do
|
| echo 'Cleaning up' $directory | indent
|
| git rm -rf $directory | indent_more
|
| done
|
|
|
|
|
| empty_lines
|
| echo Removing generators...
|
| generated_langs="dart javascript lua php python"
|
| for lang in $generated_langs
|
| do
|
| echo 'Cleaning up' $lang | indent
|
|
|
| git rm -rf generators/${lang} | indent_more
|
| done
|
|
|
|
|
| empty_lines
|
| echo Removing built files...
|
| built_files="blockly_compressed.js \
|
| blockly_uncompressed.js \
|
| blockly_accessible_compressed.js \
|
| blockly_accessible_uncompressed.js \
|
| blocks_compressed.js \
|
| dart_compressed.js \
|
| php_compressed.js \
|
| python_compressed.js \
|
| javascript_compressed.js \
|
| lua_compressed.js"
|
|
|
| for filename in $built_files
|
| do
|
| git rm $filename | indent_more
|
| done
|
|
|
| empty_lines
|
| echo Miscellaneous cleanup...
|
|
|
| keep_ours=".github/ISSUE_TEMPLATE.md \
|
| .github/PULL_REQUEST_TEMPLATE.md \
|
| .gitignore \
|
| .travis.yml \
|
| core/block_animations.js \
|
| msg/messages.js \
|
| msg/js/en.js \
|
| msg/json/en.json"
|
|
|
|
|
| for filename in $keep_ours
|
| do
|
| git checkout --ours $filename && git add $filename | indent_more
|
| done
|
|
|
|
|
|
|
| git rm -f tests/playground.html core/block_render_svg.js | indent_more
|
|
|
| empty_lines
|
| echo Done with cleanup.
|
|
|