MCPcopy
hub / github.com/vercel/next.js / notifyUpdate

Function notifyUpdate

packages/create-next-app/index.ts:783–807  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

781}).catch(() => null)
782
783async 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
809async function exit(reason: { command?: string }) {
810 console.log()

Callers 1

exitFunction · 0.85

Calls 4

getDistTagFunction · 0.85
yellowFunction · 0.85
logMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected