Skip to content

Commit ab30b01

Browse files
committed
Release 2.3.2
1 parent a6c3583 commit ab30b01

File tree

3 files changed

+55
-12
lines changed

3 files changed

+55
-12
lines changed

Diff for: CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.3.2] - 2025-02-26
11+
1012
### Fixed
1113

12-
- mage commands that are passed on to `bin/magento` or magerun with quoted arguments
14+
- `mage` commands that are passed on to `bin/magento` or magerun with quoted arguments
1315
- Missing dependency for Hyvä 1.3.10 and newer for the gitlab install
1416

1517
## [2.3.1] - 2025-02-26

Diff for: mage

+51-10
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ MAGENTO_CLI="bin/magento"
2121
MAGERUN_CLI=""
2222
REDIS_CLI="redis-cli"
2323
VARNISH_CLI="varnishadm" # We never use varnish on a local machine, and prefer to never use it
24+
PHP_CLI="php"
2425
COMPOSER_CLI="composer"
26+
NODE_CLI="node"
27+
NPM_CLI="npm"
2528
PURGE_CLI="rm -rf"
2629
OPEN_CLI="xdg-open" # Linux
2730
GET_CLI="wget" # Linux
@@ -56,7 +59,10 @@ if [ -f .env ] && grep -q "WARDEN_ENV_NAME" .env && [[ ! "$PATH" == /var/www/htm
5659
MAGERUN_CLI="warden env exec php-fpm n98-magerun"
5760
REDIS_CLI="warden env exec redis redis-cli"
5861
VARNISH_CLI="warden env exec -T varnish varnishadm"
62+
PHP_CLI="warden env exec php-fpm php"
5963
COMPOSER_CLI="warden env exec php-fpm composer"
64+
NODE_CLI="warden env exec php-fpm node"
65+
NPM_CLI="warden env exec php-fpm npm"
6066
# Run removal within environment, so that changes are in effect immediately.
6167
# Changes will get synced back to the host
6268
PURGE_CLI="warden env exec -T php-fpm rm -rf"
@@ -120,6 +126,10 @@ function get_mage_store_uri() {
120126
echo $store_url
121127
}
122128

129+
function get_composer_pkg_version() {
130+
echo -e $($COMPOSER_CLI show $1 | grep 'versions' | grep -o -E '\*\ .+' | awk '{print $2}' | cut -d',' -f1)
131+
}
132+
123133
function mage_add_hyva() {
124134
echo "Installing Hyva theme..."
125135
echo "Make sure you have and license key or access to the gitlab env"
@@ -152,6 +162,7 @@ function mage_add_hyva() {
152162
done
153163

154164
$COMPOSER_CLI config repositories.hyva-themes/magento2-graphql-tokens git [email protected]:hyva-themes/magento2-graphql-tokens.git
165+
$COMPOSER_CLI config repositories.hyva-themes/magento2-mollie-theme-bundle git [email protected]:hyva-themes/hyva-compat/magento2-mollie-theme-bundle.git
155166
$COMPOSER_CLI require hyva-themes/magento2-luma-checkout --prefer-source
156167
$COMPOSER_CLI require hyva-themes/magento2-default-theme --prefer-source
157168
fi
@@ -189,7 +200,14 @@ function mage_add_checkout() {
189200
fi
190201
}
191202

192-
MAGE_VERSION="2.3.1"
203+
function mage_build_hyva() {
204+
if [ ! -d vendor/hyva-themes/magento2-default-theme/web/tailwind/node_modules ]; then
205+
$NPM_CLI --prefix vendor/hyva-themes/magento2-default-theme/web/tailwind install;
206+
fi
207+
$NPM_CLI --prefix vendor/hyva-themes/magento2-default-theme/web/tailwind run build;
208+
}
209+
210+
MAGE_VERSION="2.3.2"
193211

194212
function mage_version() {
195213
echo -e "\n${BOLD}Mage ${GREEN}${MAGE_VERSION}${RESET}"
@@ -373,7 +391,16 @@ function mage_open() {
373391

374392
# Prefetch admin URL data for open steps
375393
if [[ "$store" == "admin" ]]; then
376-
local admin_path=$(grep frontName app/etc/env.php | tail -1 | cut -d '>' -f2 | cut -d '"' -f2 | cut -d "'" -f2)
394+
local admin_custom_path=$($MAGENTO_CLI config:show admin/url/use_custom_path)
395+
396+
if [[ $admin_custom_path == "1" ]]; then
397+
local admin_path=$($MAGENTO_CLI config:show admin/url/custom_path)
398+
else
399+
local admin_path=$(php -r "
400+
\$array = include('app/etc/env.php');
401+
if (isset(\$array['backend']['frontName'])) { echo \$array['backend']['frontName']; }
402+
" 2>/dev/null)
403+
fi
377404
fi
378405

379406
if [[ -z "$store_url" ]]; then
@@ -447,6 +474,10 @@ function mage_add_patch() {
447474
echo -e "Patch added to the composer.json in extra.patches.$vendor_folder_name"
448475
}
449476

477+
function mage_new_patch_branch_diff() {
478+
git diff $(git rev-parse --abbrev-ref origin/HEAD)..$(git branch --show-current) > $(git branch --show-current).patch
479+
}
480+
450481
function mage_new_patch_file() {
451482
local src=${1}
452483

@@ -565,12 +596,18 @@ case "${@}" in
565596
;;
566597

567598
"info")
568-
$MAGENTO_CLI --version
599+
echo -e "Magento: $GREEN$($MAGENTO_CLI --version | sed 's/Magento CLI //')$RESET"
600+
if $COMPOSER_CLI show hyva-themes/magento2-default-theme > /dev/null 2>&1; then
601+
echo -e "Hyva Theme: $GREEN$(get_composer_pkg_version 'hyva-themes/magento2-default-theme')$RESET"
602+
echo -e "Hyva Module: $GREEN$(get_composer_pkg_version 'hyva-themes/magento2-theme-module')$RESET"
603+
fi
604+
echo -e "PHP: $GREEN$($PHP_CLI --version | grep ^PHP | cut -d' ' -f2)$RESET"
605+
echo -e "NODE: $GREEN$($NODE_CLI --version | sed 's/v//')$RESET"
569606
echo -e "Base URI: $(get_mage_base_uri)"
570607
echo -e "Admin URI: $(grep frontName app/etc/env.php | tail -1 | cut -d ">" -f2 | cut -d "'" -f2)"
571608
echo -e "Database: $(grep dbname app/etc/env.php | tail -1 | cut -d ">" -f2 | cut -d "'" -f2)"
572-
$MAGENTO_CLI maintenance:status
573609
$MAGENTO_CLI deploy:mode:show
610+
$MAGENTO_CLI maintenance:status
574611
if [[ -n "$MAGENTO_CLI config:show catalog/search/engine" ]]; then
575612
echo -e "Search Engine: $($MAGENTO_CLI config:show catalog/search/engine)"
576613
fi
@@ -605,7 +642,7 @@ case "${@}" in
605642

606643
if [[ $WARDEN == 1 ]]; then
607644
# NOTE: we need to sadly hard code the path,
608-
# but lukcy we can since the warden container is always the same
645+
# but lucky we can since the warden container is always the same
609646
warden env exec php-fpm /home/www-data/.composer/vendor/bin/cache-clean.js -w
610647
else
611648
$cache_cli
@@ -704,12 +741,12 @@ case "${@}" in
704741
;;
705742

706743
"add baldr")
707-
composer config repositories.siteation/magento2-theme-baldr git [email protected]:Siteation/magento2-theme-baldr.git
708-
composer require siteation/magento2-theme-baldr
744+
$COMPOSER_CLI config repositories.siteation/magento2-theme-baldr git [email protected]:Siteation/magento2-theme-baldr.git
745+
$COMPOSER_CLI require siteation/magento2-theme-baldr
709746
;;
710747

711748
"set theme"*)
712-
if composer show yireo/magento2-theme-commands > /dev/null 2>&1; then
749+
if $COMPOSER_CLI show yireo/magento2-theme-commands > /dev/null 2>&1; then
713750
$MAGENTO_CLI theme:change $3
714751
$MAGENTO_CLI cache:flush;
715752
else
@@ -811,6 +848,10 @@ case "${@}" in
811848
$COMPOSER_CLI outdated --direct --no-dev --ignore symfony/finder --ignore symfony/process --format json > composer-outdated.json
812849
;;
813850

851+
"build hyva")
852+
mage_build_hyva
853+
;;
854+
814855
"build"*)
815856
default_args="-j 4"
816857
args=${@:2}
@@ -819,14 +860,14 @@ case "${@}" in
819860

820861
"run"*)
821862
if [[ -n "$MAGERUN_CLI" ]]; then
822-
$MAGERUN_CLI ${@:2}
863+
$MAGERUN_CLI "${@:2}"
823864
else
824865
echo $NO_MAGERUN_MSG
825866
fi
826867
;;
827868

828869
*)
829-
$MAGENTO_CLI $@
870+
$MAGENTO_CLI "$@"
830871
;;
831872
esac
832873

Diff for: src/_info.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MAGE_VERSION="2.3.1"
1+
MAGE_VERSION="2.3.2"
22

33
function mage_version() {
44
echo -e "\n${BOLD}Mage ${GREEN}${MAGE_VERSION}${RESET}"

0 commit comments

Comments
 (0)