Fix to correctly handle builds for multiple types

This commit is contained in:
Ilia Ross
2024-12-31 03:18:44 +02:00
parent ee994bef2f
commit 2a81aabf96
3 changed files with 18 additions and 11 deletions

View File

@@ -71,8 +71,10 @@ build_prod() {
# Print package version
echo -n " package version: "
# Get latest product version (theme vs product); expects to start in theme
# repo and switch to product repo internally
# Switch to product directory explicitly
cd "$root_prod" || exit 1
# Get latest product version (theme vs product)
date_version=$(get_latest_commit_date_version "$root_prod")
# Handle other params

View File

@@ -70,8 +70,10 @@ build_prod() {
# Print package version
echo -n " package version: "
# Get latest product version (theme vs product); expects to start in theme
# repo and switch to product repo internally
# Switch to product directory explicitly
cd "$root_prod" || exit 1
# Get latest product version (theme vs product)
date_version=$(get_latest_commit_date_version "$root_prod")
# Handle other params

View File

@@ -201,13 +201,16 @@ get_latest_commit_date_version() {
local max_prod
local highest_version
local root_prod="$1"
theme_version=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d%H%M')
cd "$root_prod" || exit 1
prod_version=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d%H%M')
max_prod=("$theme_version" "$prod_version")
highest_version=$(max "${max_prod[@]}")
echo "$highest_version"
local root_theme="$root_prod/authentic-theme"
(
cd "$root_theme" || exit 1
theme_version=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d%H%M')
cd "$root_prod" || exit 1
prod_version=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d%H%M')
max_prod=("$theme_version" "$prod_version")
highest_version=$(max "${max_prod[@]}")
echo "$highest_version"
)
}
# Pull project repo and theme