Skip to content

Commit

Permalink
Remove patch_version_php() from bin/init-db-and-generate-static-site.sh
Browse files Browse the repository at this point in the history
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 f380694
  • Loading branch information
anthonyfok committed Jun 28, 2023
1 parent 233331c commit 8839beb
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions bin/init-db-and-generate-static-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 '(<a href="https://github.com/OpenDRR/riskprofiler/tree/' . $git_describe . '" class="text-gray-400">' . $build_number . '</a>)';\
\
echo '<span class="mx-1">•</span>';\
}\
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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8839beb

Please sign in to comment.