themes-wordpress/package-dotorg.sh

22 lines
927 B
Bash
Raw Normal View History

2020-11-04 17:27:09 +00:00
#!/bin/zsh
if [[ "$1" != "" ]]; then
THEME="$1"
find $THEME/assets/sass/*.scss -type f -exec sed -i '' 's/-wpcom//g' {} \;
find $THEME/assets/sass/*.scss -type f -exec sed -i '' 's/, auto-loading-homepage//g' {} \;
find $THEME/assets/sass/*.scss -type f -exec sed -i '' 's/, jetpack-global-styles//g' {} \;
find $THEME/style.css -type f -exec sed -i '' 's/-wpcom//g' {} \;
find $THEME/style.css -type f -exec sed -i '' 's/, auto-loading-homepage//g' {} \;
find $THEME/style.css -type f -exec sed -i '' 's/, jetpack-global-styles//g' {} \;
2020-11-04 17:27:09 +00:00
cd $THEME && npm run build;
mkdir $THEME;
rsync -avz --exclude $THEME --exclude-from '../dotorg-exclude.txt' ./ $THEME
2020-11-04 17:27:09 +00:00
find $THEME -type f -name '*.map' -delete # for some reason rsync won't exclude map files
rm -rf $THEME/$THEME
zip -r -X $THEME.zip $THEME
rm -rf $THEME
git restore ./
else
echo "Please provide the theme slug as an argument to the script."
fi