Skip to content

Commit

Permalink
Merge pull request #593 from Codeinwp/fix-dev-build
Browse files Browse the repository at this point in the history
fix: dev build
  • Loading branch information
abaicus authored Jul 6, 2023
2 parents 48f60e5 + 004ddcc commit 4c8abb9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bin/dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@ fi
rsync -rc --exclude-from ".distignore" "./" "dist/$DIST_FOLDER"

if [ "$1" = "--dev" ]; then
cp -f "development.php" "dist/$DIST_FOLDER"
echo "require_once OPTML_PATH . '/development.php';" >> "dist/$DIST_FOLDER/optimole-wp.php"
cp -f "development.php" "dist/$DIST_FOLDER"
file="dist/$DIST_FOLDER/optimole-wp.php"

# Necessary for mac os.
if [[ $(uname -s) == 'Darwin' ]]; then
I_FLAG='-i.bak'
else
I_FLAG='-i'
fi

sed $I_FLAG "s/define( 'OPTML_BASEFILE', __FILE__ );/define( 'OPTML_BASEFILE', __FILE__ );\nrequire_once OPTML_PATH . '\/development.php';/" $file

fi

cd dist
Expand Down

0 comments on commit 4c8abb9

Please sign in to comment.