Alberto Maturano 154fc28a57 Normalize to standar file permissions
As a result of taking a look on PR #1967 I realized there is 819
executable files in this repository. It is obvious this is an error.
2018-09-24 12:33:09 -05:00

39 lines
894 B
JavaScript

'use strict';
/**
* Module dependencies
*/
const { exec } = require('child_process');
const path = require('path');
const fs = require('fs-extra');
const { packageManager } = require('strapi-utils'); // eslint-disable-line import/no-unresolved
/**
* Runs after this generator has finished
*
* @param {Object} scope
* @param {Function} cb
*/
module.exports = (scope, cb) => {
// Copy the admin files.
fs.copySync(path.resolve(__dirname, '..', 'files'), path.resolve(scope.rootPath, 'admin'));
if (scope.developerMode) {
return cb();
}
// Install back-end admin `node_modules`.
const cmd = packageManager.isStrapiInstalledWithNPM() ? 'npm install --production --ignore-scripts' : 'yarn install --production --ignore-scripts';
exec(cmd, {
cwd: path.resolve(scope.rootPath, 'admin')
}, (err) => {
if (err) {
return cb(err);
}
cb();
});
};