mirror of
https://github.com/strapi/strapi.git
synced 2025-12-30 00:37:24 +00:00
Fix monorepo setup
This commit is contained in:
parent
0a9f81765e
commit
fb35bc75e0
@ -4,13 +4,16 @@ const shell = require('shelljs');
|
||||
const pwd = shell.pwd();
|
||||
const isDevelopmentMode = path.resolve(pwd.stdout).indexOf('strapi-admin') !== -1;
|
||||
const appPath = isDevelopmentMode ? path.resolve(process.env.PWD, '..') : path.resolve(pwd.stdout, '..');
|
||||
const isSetup = path.resolve(process.env.PWD, '..', '..') === path.resolve(process.env.INIT_CWD);
|
||||
|
||||
const strapi = require(path.join(appPath, 'node_modules', 'strapi'));
|
||||
strapi.config.appPath = appPath;
|
||||
strapi.log.level = 'silent';
|
||||
if (!isSetup) {
|
||||
const strapi = require(path.join(appPath, 'node_modules', 'strapi'));
|
||||
strapi.config.appPath = appPath;
|
||||
strapi.log.level = 'silent';
|
||||
|
||||
(async () => {
|
||||
await strapi.load({
|
||||
environment: process.env.NODE_ENV,
|
||||
});
|
||||
})();
|
||||
(async () => {
|
||||
await strapi.load({
|
||||
environment: process.env.NODE_ENV,
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user