From 49d4143b736ce3755ece55d63bb4c02f4f68f27f Mon Sep 17 00:00:00 2001 From: Andrew Allsopp Date: Wed, 14 Jul 2021 12:32:03 +0100 Subject: [PATCH] 1.1.15 release - improved documentation and build process --- docs/build/index.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/build/index.php b/docs/build/index.php index 9945c9d..c20f701 100644 --- a/docs/build/index.php +++ b/docs/build/index.php @@ -10,18 +10,27 @@ $readme_file = '../../README.md'; $script_file = '../../dist/hass-hue-icons.js'; -$version = isset($_GET['v']) ? $_GET['v'] : null; +$new_version = isset($_GET['v']) ? $_GET['v'] : null; +$version = find_version($script_file); -echo 'Was version:' . find_version($script_file) . '
'; -if(!is_null($version)){ - echo 'New version:' . $version . '
'; +// handle versioning +$version_components = explode('.',$version); +echo 'Was version:' . $version; +if(!is_null($new_version)){ + echo '
This version:' . $new_version; + $version_components = explode('.',$new_version); } +$version_components[2] = intval($version_components[2]) + 1; +$incremented_version = join('.',$version_components); +echo '
Increment to version ' . $incremented_version . '
'; + + $hue_icons = read_files('../svgs/'); $custom_icons = read_files('../custom_svgs/'); update_readme($readme_file,$hue_icons,$custom_icons); -update_script($script_file,$hue_icons,$custom_icons,$version); +update_script($script_file,$hue_icons,$custom_icons,$new_version); function find_version($script_file){