Merge pull request #19725 from backstage/rugvip/warning
create-app: warn if yarn install is taking a long time
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/create-app': patch
|
||||
---
|
||||
|
||||
Add a notification when `yarn install` is taking a long time.
|
||||
@@ -31,6 +31,7 @@ import { promisify } from 'util';
|
||||
import os from 'os';
|
||||
|
||||
const TASK_NAME_MAX_LENGTH = 14;
|
||||
const TEN_MINUTES_MS = 1000 * 60 * 10;
|
||||
const exec = promisify(execCb);
|
||||
|
||||
export type GitConfig = {
|
||||
@@ -222,7 +223,13 @@ export async function buildAppTask(appDir: string) {
|
||||
});
|
||||
};
|
||||
|
||||
await runCmd('yarn install');
|
||||
const installTimeout = setTimeout(() => {
|
||||
Task.error(
|
||||
"\n⏱️ It's taking a long time to install dependencies, you may want to exit (Ctrl-C) and run 'yarn install' and 'yarn tsc' manually",
|
||||
);
|
||||
}, TEN_MINUTES_MS);
|
||||
|
||||
await runCmd('yarn install').finally(() => clearTimeout(installTimeout));
|
||||
await runCmd('yarn tsc');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user