diff --git a/ghu.js b/ghu.js index d92aa134..b79f65d0 100644 --- a/ghu.js +++ b/ghu.js @@ -1,7 +1,7 @@ const {resolve, join} = require('path'); const { - default: ghu, - autoprefixer, cssmin, ife, includeit, jade, jszip, + ghu, + autoprefixer, cssmin, each, ife, includeit, jade, jszip, less, mapfn, newerThan, read, remove, run, uglify, watch, wrap, write } = require('ghu'); @@ -88,6 +88,11 @@ ghu.task('build:copy', runtime => { read(`${SRC}: **, ! **/*.js, ! **/*.less, ! **/*.jade, ! **/conf/*.json`) .then(newerThan(mapper)) + .then(each(obj => { + if (/index\.php$/.test(obj.source)) { + obj.content = obj.content.replace('{{VERSION}}', runtime.pkg.version); + } + })) .then(write(mapper, {overwrite: true, cluster: true})), read(`${ROOT}/*.md`) diff --git a/package.json b/package.json index 87ac06a3..de5f6789 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,11 @@ "build": "npm run -s ghu release" }, "devDependencies": { - "babel-core": "6.3.17", + "babel-core": "6.3.21", "babel-eslint": "5.0.0-beta6", "babel-preset-es2015": "6.3.13", "eslint": "1.10.3", - "ghu": "0.2.2" + "ghu": "0.4.0" }, "engines": { "node": ">=5.0.0" diff --git a/src/_h5ai/private/php/core/class-setup.php b/src/_h5ai/private/php/core/class-setup.php index 3ccc1c13..8743dee9 100644 --- a/src/_h5ai/private/php/core/class-setup.php +++ b/src/_h5ai/private/php/core/class-setup.php @@ -75,7 +75,7 @@ class Setup { private function add_app_metadata() { $this->set('NAME', 'h5ai'); - $this->set('VERSION', '{{pkg.version}}'); + $this->set('VERSION', H5AI_VERSION); $this->set('FILE_PREFIX', '_h5ai'); } diff --git a/src/_h5ai/public/index.php b/src/_h5ai/public/index.php index 493b0350..5ba4cf72 100644 --- a/src/_h5ai/public/index.php +++ b/src/_h5ai/public/index.php @@ -1,6 +1,7 @@