Skip to content

Commit

Permalink
Updated build process to shutup 'Warning: The TextDomain header in th…
Browse files Browse the repository at this point in the history
…e plugin file does not match the slug. Found betterportal-theme-embedded, expected build.'
  • Loading branch information
mrinc committed Oct 9, 2024
1 parent ee36ff7 commit abfa6ee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
12 changes: 12 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,15 @@ sed -i "s/{{VERSION}}/$VERSION/g" $BUILD_DIR/scripts/betterportal-loader.min.js
# Update references to use minified files
sed -i 's/betterportal-loader\.css/betterportal-loader.min.css/g' $BUILD_DIR/betterportal-theme-embedded.php
sed -i 's/betterportal-loader\.js/betterportal-loader.min.js/g' $BUILD_DIR/betterportal-theme-embedded.php

TEMP_DIR=$(mktemp -d)
T_PLUGIN_DIR="$TEMP_DIR/$PLUGIN_DIR"
mkdir -p "$T_PLUGIN_DIR"

cp -R $BUILD_DIR/* "$T_PLUGIN_DIR"

rm -rf $BUILD_DIR/*

mv $T_PLUGIN_DIR $BUILD_DIR

rm -rf $TEMP_DIR
1 change: 1 addition & 0 deletions envs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ export JS_FILE="scripts/betterportal-loader.js"
export PLUGIN_README="PLUGIN_README.txt"
export LICENSE_FILE="LICENSE"
export DEFINITION_FILE="DEFINITION.txt"
export PLUGIN_DIR="betterportal-theme-embedded"
15 changes: 2 additions & 13 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,9 @@ source ./envs.sh
# Create the distribution directory if it doesn't exist
mkdir -p $DIST_DIR

# Create a temporary directory for the plugin
TEMP_DIR=$(mktemp -d)
PLUGIN_DIR="$TEMP_DIR/betterportal-theme-embedded"
mkdir -p "$PLUGIN_DIR"

# Copy build files to the plugin directory
cp -R $BUILD_DIR/* "$PLUGIN_DIR"

# Change to the temporary directory and create the zip file
pushd $TEMP_DIR
zip -r $DIST_DIR/betterportal-theme-embedded-v$VERSION.zip betterportal-theme-embedded -x ".*" -x "__MACOSX"
pushd $BUILD_DIR
zip -r $DIST_DIR/betterportal-theme-embedded-v$VERSION.zip . -x ".*" -x "__MACOSX"
popd

# Clean up the temporary directory
rm -rf $TEMP_DIR

echo "Plugin zip file created: $DIST_DIR/betterportal-theme-embedded-v$VERSION.zip"

0 comments on commit abfa6ee

Please sign in to comment.