mirror of
https://github.com/strapi/strapi.git
synced 2025-09-21 14:31:16 +00:00
Merge branch 'main' into feature/relations-reordering
This commit is contained in:
commit
865b5d1fcd
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { join, resolve } = require('path');
|
const { join, resolve, sep, posix } = require('path');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
@ -8,8 +8,22 @@ const glob = require('glob');
|
|||||||
// Only for dev environement
|
// Only for dev environement
|
||||||
const getPluginsPath = () => {
|
const getPluginsPath = () => {
|
||||||
const rootPath = resolve(__dirname, '..', join('..', '..', '..', 'packages'));
|
const rootPath = resolve(__dirname, '..', join('..', '..', '..', 'packages'));
|
||||||
const corePath = join(rootPath, 'core', '*');
|
/**
|
||||||
const pluginsPath = join(rootPath, 'plugins', '*');
|
* So `glob` only supports '/' as a path separator, so we need to replace
|
||||||
|
* the path separator for the current OS with '/'. e.g. on windows it's `\`.
|
||||||
|
*
|
||||||
|
* see https://github.com/isaacs/node-glob/#windows for more information
|
||||||
|
*
|
||||||
|
* and see https://github.com/isaacs/node-glob/issues/467#issuecomment-1114240501 for the recommended fix.
|
||||||
|
*/
|
||||||
|
let corePath = join(rootPath, 'core', '*');
|
||||||
|
let pluginsPath = join(rootPath, 'plugins', '*');
|
||||||
|
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
corePath = corePath.split(sep).join(posix.sep);
|
||||||
|
pluginsPath = pluginsPath.split(sep).join(posix.sep);
|
||||||
|
}
|
||||||
|
|
||||||
const corePackageDirs = glob.sync(corePath);
|
const corePackageDirs = glob.sync(corePath);
|
||||||
const pluginsPackageDirs = glob.sync(pluginsPath);
|
const pluginsPackageDirs = glob.sync(pluginsPath);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user