|
@@ -1,4 +1,4 @@
|
|
-
|
|
|
|
|
|
+var childProcess = require('child-process');
|
|
var webpack = require('webpack');
|
|
var webpack = require('webpack');
|
|
var path = require('path');
|
|
var path = require('path');
|
|
var fs = require('fs-extra');
|
|
var fs = require('fs-extra');
|
|
@@ -26,6 +26,30 @@ hash.update(fs.readFileSync('./package.json'));
|
|
fs.writeFileSync('build/hash.md5', hash.digest('hex'));
|
|
fs.writeFileSync('build/hash.md5', hash.digest('hex'));
|
|
|
|
|
|
|
|
|
|
|
|
+// Get the version and git description if needed
|
|
|
|
+if (!package_data.jupyterlab.version) {
|
|
|
|
+ try {
|
|
|
|
+ var notice = childProcess.execSync('git describe', { encoding: 'utf8' });
|
|
|
|
+ } catch (e) {
|
|
|
|
+ var notice = 'unknown';
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // Get the python package version.
|
|
|
|
+ var cwd = process.cwd();
|
|
|
|
+ process.chdir('..');
|
|
|
|
+ try {
|
|
|
|
+ var version = childProcess.execSync('python setup.py --version', { encoding: 'utf8' });
|
|
|
|
+ } catch (e) {
|
|
|
|
+ var version = 'unknown';
|
|
|
|
+ }
|
|
|
|
+ process.chdir(cwd);
|
|
|
|
+
|
|
|
|
+ package_data.jupyterlab.version = version;
|
|
|
|
+ package_data.jupyterlab.gitDescription = notice;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
// Note that we have to use an explicit local public path
|
|
// Note that we have to use an explicit local public path
|
|
// otherwise the urls in the extracted CSS will point to the wrong
|
|
// otherwise the urls in the extracted CSS will point to the wrong
|
|
// location.
|
|
// location.
|