Fix PR feedback

This commit is contained in:
soupette 2018-07-10 11:08:58 +02:00
parent 09e8892190
commit b902367790
4 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@
const { exec } = require('child_process');
const path = require('path');
const fs = require('fs-extra');
const { packageManager } = require('strapi-utils');
const { packageManager } = require('strapi-utils'); // eslint-disable-line import/no-unresolved
/**
* Runs after this generator has finished

View File

@ -17,7 +17,7 @@ const { packageManager } = require('strapi-utils');
module.exports = scope => {
const cliPkg = scope.strapiPackageJSON || {};
// Store the package manager info into the package.json
const pckManager = packageManager.isStrapiInstalledWithNPM() ? 'npm' : 'yarn';
const packageManager = packageManager.isStrapiInstalledWithNPM() ? 'npm' : 'yarn';
// Let us install additional dependencies on a specific version.
// Ex: it allows us to install the right version of knex.
@ -71,7 +71,7 @@ module.exports = scope => {
'url': scope.website || ''
}],
'strapi': {
'packageManager': pckManager,
'packageManager': packageManager,
'uuid': uuid()
},
'engines': {

View File

@ -52,7 +52,7 @@ module.exports = (scope, cb) => {
const othersDependencies = Object.keys(dependencies).filter(key => key.indexOf('strapi') === -1);
// Add this check to know if we are in development mode so the creation is faster.
const isStrapiInstalledWithNPM = packageManager.isStrapiInstalledWithNPM();
const globalRootPath = isStrapiInstalledWithNPM ? execSync('npm root -g') : execSync(packageManager.commands('root -g'));
const globalRootPath = execSync(packageManager.commands('root -g'));
// Verify if the dependencies are available into the global
_.forEach(strapiDependencies, (key) => {

View File

@ -211,7 +211,7 @@ module.exports = (scope, cb) => {
}),
new Promise(resolve => {
const isStrapiInstalledWithNPM = packageManager.isStrapiInstalledWithNPM();
let packageCmd = isStrapiInstalledWithNPM ? `npm install --prefix "${scope.tmpPath}" ${scope.client.connector}@alpha` : packageManager.commands('install --prefix', scope.tmpPath);
let packageCmd = packageManager.commands('install --prefix', scope.tmpPath);
// Manually create the temp directory for yarn
if (!isStrapiInstalledWithNPM) {
shell.exec('mkdir tmp');