Skip to content

Commit 8890290

Browse files
committed
fix relative path problem
1 parent b0b2b60 commit 8890290

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

commands/transform.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { join } from 'node:path'
1+
import { join, resolve } from 'node:path'
22
import type { Options } from 'jscodeshift'
33
import { run as jscodeshift } from 'jscodeshift/src/Runner'
44
import { bold } from 'picocolors'
@@ -52,6 +52,8 @@ export async function transform(codemodName?: string, source?: string, options?:
5252
sourceSelected = res.path
5353
}
5454

55+
sourceSelected = resolve(sourceSelected || '')
56+
5557
if (!codemodSelected) {
5658
console.info('> Codemod is not selected. Exist the program. \n')
5759
process.exit(1)

0 commit comments

Comments
 (0)