()
| 781 | }).catch(() => null) |
| 782 | |
| 783 | async function notifyUpdate(): Promise<void> { |
| 784 | try { |
| 785 | if ((await update)?.latest) { |
| 786 | const global = { |
| 787 | npm: 'npm i -g', |
| 788 | yarn: 'yarn global add', |
| 789 | pnpm: 'pnpm add -g', |
| 790 | bun: 'bun add -g', |
| 791 | } |
| 792 | const distTag = getDistTag(packageJson.version) |
| 793 | const pkgTag = distTag === 'latest' ? '' : `@${distTag}` |
| 794 | const updateMessage = `${global[packageManager]} create-next-app${pkgTag}` |
| 795 | console.log( |
| 796 | yellow(bold('A new version of `create-next-app` is available!')) + |
| 797 | '\n' + |
| 798 | 'You can update by running: ' + |
| 799 | cyan(updateMessage) + |
| 800 | '\n' |
| 801 | ) |
| 802 | } |
| 803 | process.exit(0) |
| 804 | } catch { |
| 805 | // ignore error |
| 806 | } |
| 807 | } |
| 808 | |
| 809 | async function exit(reason: { command?: string }) { |
| 810 | console.log() |
no test coverage detected