Skip to content

Commit f95faf8

Browse files
committed
next-upgrade: Allow choosing same codemods that are available in the currently used version
1 parent 986667a commit f95faf8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/next-codemod/bin/upgrade.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { compareVersions } from 'compare-versions'
66
import chalk from 'chalk'
77
import { availableCodemods } from '../lib/codemods'
88
import { getPkgManager, installPackages } from '../lib/handle-package'
9+
import { runTransform } from './transform'
910

1011
type StandardVersionSpecifier = 'canary' | 'rc' | 'latest'
1112
type CustomVersionSpecifier = string
@@ -358,11 +359,6 @@ async function suggestCodemods(
358359
)
359360

360361
for (const codemod of codemods) {
361-
execSync(
362-
`npx --yes @next/codemod@latest ${codemod} ${process.cwd()} --force`,
363-
{
364-
stdio: 'inherit',
365-
}
366-
)
362+
await runTransform(codemod, process.cwd(), { force: true })
367363
}
368364
}

0 commit comments

Comments
 (0)