2016-12-01 16:44:03 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Module dependencies
|
|
|
|
*/
|
|
|
|
|
2017-08-24 13:48:19 +02:00
|
|
|
const { exec } = require('child_process');
|
|
|
|
const path = require('path');
|
|
|
|
|
2016-12-01 16:44:03 +01:00
|
|
|
/**
|
|
|
|
* Runs after this generator has finished
|
|
|
|
*
|
|
|
|
* @param {Object} scope
|
|
|
|
* @param {Function} cb
|
|
|
|
*/
|
|
|
|
|
2017-08-24 13:48:19 +02:00
|
|
|
module.exports = (scope, cb) => {
|
2017-09-27 17:55:51 +02:00
|
|
|
if (scope.developerMode) {
|
|
|
|
return cb();
|
|
|
|
}
|
|
|
|
|
2017-09-08 17:14:11 +02:00
|
|
|
// Install back-end admin `node_modules`.
|
|
|
|
exec('npm install --production --ignore-scripts', {
|
2017-08-24 13:48:19 +02:00
|
|
|
cwd: path.resolve(scope.rootPath, 'admin')
|
2017-09-08 17:14:11 +02:00
|
|
|
}, (err) => {
|
2017-08-24 13:48:19 +02:00
|
|
|
if (err) {
|
|
|
|
return cb(err);
|
|
|
|
}
|
2016-12-01 16:44:03 +01:00
|
|
|
|
2017-08-24 13:48:19 +02:00
|
|
|
cb();
|
|
|
|
});
|
2016-12-01 16:44:03 +01:00
|
|
|
};
|