2020-11-04 17:27:09 +00:00
|
|
|
#!/bin/zsh
|
|
|
|
if [[ "$1" != "" ]]; then
|
|
|
|
THEME="$1"
|
2020-11-06 18:37:25 +00:00
|
|
|
find $THEME/assets/sass/*.scss -type f -exec sed -i '' 's/-wpcom//g' {} \;
|
2020-11-06 18:38:29 +00:00
|
|
|
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' {} \;
|
2021-10-20 11:12:15 +00:00
|
|
|
|
|
|
|
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;
|
2022-07-19 20:51:29 +00:00
|
|
|
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
|