From 8839beb0b901dd2b96fef96d122f51fc764d7159 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Wed, 28 Jun 2023 17:54:02 -0600 Subject: [PATCH] Remove patch_version_php() from bin/init-db-and-generate-static-site.sh The patch has been applied upstream at OpenDRR/h7-riskprofiler commit adab6a45f98f8f1a5742d82b4b16e0f7249b1317 titled "Append build number (based on "git describe") to the site version". This reverts my previous temporary hack from July 2022 at commit f380694c117f2674be8a81d4f24b4b3532bc9db2 --- bin/init-db-and-generate-static-site.sh | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/bin/init-db-and-generate-static-site.sh b/bin/init-db-and-generate-static-site.sh index 43312a30..70d00105 100755 --- a/bin/init-db-and-generate-static-site.sh +++ b/bin/init-db-and-generate-static-site.sh @@ -177,30 +177,6 @@ set_api_version() { wp option update options_fr_api_version "$API_VERSION" } -patch_version_php() { - # Append build number to the site version - sed -i -f - site/assets/themes/fw-child/template/version.php <<'EOF' -/^?>/i\ - if ($git_describe = get_option ( 'options_git_describe' )) {\ - list($version, $api_version, $release_date, $commits_since, $commit_hash) = explode("-", $git_describe);\ -\ - if ($commits_since == 0) {\ - $git_describe = implode('-', [$version, $api_version, $release_date]);\ - }\ -\ - $build_number = sprintf("%04d", $release_date - 20220000);\ - if ($commits_since > 0) {\ - $build_number = implode('-', [$build_number, $commits_since, $commit_hash]);\ - }\ -\ - echo '(' . $build_number . ')';\ -\ - echo '';\ - }\ - -EOF -} - trigger_wpml_st_sync_translation_files() { ls -l /var/www/html/site/assets/languages/wpml/*.mo || : # Need to remove existing MO files first as they may have a @@ -364,7 +340,6 @@ main() { get_git_describe set_riskprofiler_version set_api_version - patch_version_php trigger_wpml_st_sync_translation_files simply_static_site_export fixup_static_site