mirror of
https://github.com/strapi/strapi.git
synced 2025-12-26 22:54:31 +00:00
Fix PR feedback
This commit is contained in:
parent
09e8892190
commit
b902367790
@ -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
|
||||
|
||||
@ -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': {
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user