Skip to content

Commit 6e160cc

Browse files
committed
Fixes initializer output path
1 parent 2decf6a commit 6e160cc

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.changeset/smart-melons-sell.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@codeshift/cli': patch
3+
'@codeshift/initializer': patch
4+
---
5+
6+
Additional init path releated fixes

packages/cli/src/init.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path';
12
import { initDirectory } from '@codeshift/initializer';
23

34
export default async function init(
@@ -15,6 +16,6 @@ export default async function init(
1516
}
1617

1718
console.log(
18-
`🚚 New codemod package created at: ${targetPath}/${packageName}`,
19+
`🚚 New codemod package created at: ${path.join(targetPath, packageName)}`,
1920
);
2021
}

packages/initializer/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function initDirectory(
110110
}
111111

112112
const basePath = `${targetPath}/${packageName.replace('/', '__')}`;
113-
const transformPath = `${basePath}${!isReduced ? '/src/' : ''}/${transform}`;
113+
const transformPath = `${basePath}${!isReduced ? '/src' : ''}/${transform}`;
114114
const configPath = `${basePath}${
115115
!isReduced ? '/src' : ''
116116
}/codeshift.config.js`;

0 commit comments

Comments
 (0)