Skip to content

Commit

Permalink
fix: remove error process env branch (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 authored Nov 17, 2020
1 parent 12b7854 commit 53ddc4c
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions packages/web/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,16 @@ function getFramework() {
/**
* create real egg loader and application object
*/
if (process.env.MIDWAY_PROJECT_APPDIR) {
const pkg = safeRequire(
join(process.env.MIDWAY_PROJECT_APPDIR, 'package.json'),
false
);
customFramework = safelyGet('egg.framework', pkg);
if (customFramework) {
return customFramework;
} else {
throw new Error(
`customFramework not found in ${process.env.MIDWAY_PROJECT_APPDIR}`
);
}
const pkg = safeRequire(
join(process.env.MIDWAY_PROJECT_APPDIR || process.cwd(), 'package.json'),
false
);
customFramework = safelyGet('egg.framework', pkg);
if (customFramework) {
return customFramework;
} else {
return 'egg';
}
return 'egg';
}

export const createAppWorkerLoader = () => {
Expand Down

0 comments on commit 53ddc4c

Please sign in to comment.