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){