mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Make things async
This commit is contained in:
parent
b82f0a3d01
commit
6b7f1e0c4e
@ -308,14 +308,14 @@ async function watchFiles(dir) {
|
||||
});
|
||||
}
|
||||
|
||||
const hasCustomAdminCode = (dir) => {
|
||||
const hasCustomAdminCode = async (dir) => {
|
||||
const customAdminPath = path.join(dir, 'src/admin');
|
||||
|
||||
if (!fs.pathExistsSync(customAdminPath)) {
|
||||
if (!(await fs.pathExists(customAdminPath))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const files = fs.readdirSync(customAdminPath);
|
||||
const files = await fs.readdir(customAdminPath);
|
||||
|
||||
return files.length > 0;
|
||||
};
|
||||
@ -336,7 +336,7 @@ const hasNonDefaultPlugins = (plugins) => {
|
||||
};
|
||||
|
||||
async function shouldBuildAdmin({ dir, plugins }) {
|
||||
const appHasCustomAdminCode = hasCustomAdminCode(dir);
|
||||
const appHasCustomAdminCode = await hasCustomAdminCode(dir);
|
||||
const appHasNonDefaultPlugins = hasNonDefaultPlugins(plugins);
|
||||
|
||||
return appHasCustomAdminCode || appHasNonDefaultPlugins;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user