mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 07:00:11 +01:00
Show the version number with the website
This commit is contained in:
parent
7abb948157
commit
2d6057d65f
4 changed files with 27 additions and 4 deletions
11
gulpfile.js
11
gulpfile.js
|
|
@ -10,6 +10,16 @@ var httpServer = require('http-server');
|
|||
|
||||
var SAMPLES_MDOC_PATH = path.join(__dirname, 'website/playground/playground.mdoc');
|
||||
var WEBSITE_GENERATED_PATH = path.join(__dirname, 'website/playground/samples');
|
||||
var MONACO_EDITOR_VERSION = (function() {
|
||||
var packageJsonPath = path.join(__dirname, 'package.json');
|
||||
var packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString());
|
||||
var version = packageJson.version;
|
||||
if (!/\d+\.\d+\.\d+/.test(version)) {
|
||||
console.log('unrecognized package.json version: ' + version);
|
||||
process.exit(0);
|
||||
}
|
||||
return version;
|
||||
})();
|
||||
|
||||
gulp.task('clean-release', function(cb) { rimraf('release', { maxBusyTries: 1 }, cb); });
|
||||
gulp.task('release', ['clean-release'], function() {
|
||||
|
|
@ -344,6 +354,7 @@ gulp.task('website', ['clean-website', 'playground-samples'], function() {
|
|||
|
||||
var contents = data.contents.toString();
|
||||
contents = contents.replace(/\.\.\/release\/dev/g, 'node_modules/monaco-editor/min');
|
||||
contents = contents.replace(/{{version}}/g, MONACO_EDITOR_VERSION);
|
||||
// contents = contents.replace('© 2016 Microsoft', '© 2016 Microsoft [' + builtTime + ']');
|
||||
|
||||
data.contents = new Buffer(contents);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue