From 6e269a7120b210642f5f035d61136513af7543d8 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 29 May 2014 04:32:41 +0000 Subject: [PATCH] Append the date to $wp_version in the build output, for nightly packages. props azaozz. fixes #26751. git-svn-id: https://develop.svn.wordpress.org/trunk@28611 602fd350-edb4-49c9-b593-d223f7449a82 --- Gruntfile.js | 9 ++++++++- src/wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 2bb7beb9e2..5c343fa084 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -79,7 +79,14 @@ module.exports = function(grunt) { version: { options: { processContent: function( src ) { - return src.replace( /^(\$wp_version.+?)-src';/m, '$1\';' ); + return src.replace( /^\$wp_version = '(.+?)';/m, function( str, version ) { + version = version.replace( /-src$/, '' ); + + // If the version includes an SVN commit (-12345), it's not a released alpha/beta. Append a date. + version = version.replace( /-[\d]{5}$/, '-' + grunt.template.today( 'yyyymmdd' ) ); + + return "$wp_version = '" + version + "';"; + }); } }, src: SOURCE_DIR + 'wp-includes/version.php', diff --git a/src/wp-includes/version.php b/src/wp-includes/version.php index 74dfecf453..0feb5ee755 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.0-alpha-src'; +$wp_version = '4.0-alpha-28611-src'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.