Skip to content

Commit 2decf6a

Browse files
committed
Fixes initializer output path
1 parent 307fc53 commit 2decf6a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/perfect-wombats-leave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@codeshift/initializer': patch
3+
---
4+
5+
Fix output dir path

packages/initializer/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function initDirectory(
100100
packageName: string,
101101
transform: string,
102102
type: 'version' | 'preset',
103-
path: string = './',
103+
targetPath: string = './',
104104
isReduced: boolean = false,
105105
) {
106106
if (type === 'version' && !semver.valid(transform)) {
@@ -109,7 +109,7 @@ export function initDirectory(
109109
);
110110
}
111111

112-
const basePath = `${path}/${packageName.replace('/', '__')}`;
112+
const basePath = `${targetPath}/${packageName.replace('/', '__')}`;
113113
const transformPath = `${basePath}${!isReduced ? '/src/' : ''}/${transform}`;
114114
const configPath = `${basePath}${
115115
!isReduced ? '/src' : ''
@@ -121,7 +121,7 @@ export function initDirectory(
121121

122122
fs.copySync(`${__dirname}/../template${isReduced ? '/src' : ''}`, basePath);
123123
fs.renameSync(
124-
`${basePath}${!isReduced ? '/src/' : ''}/codemod`,
124+
`${basePath}${!isReduced ? '/src' : ''}/codemod`,
125125
transformPath,
126126
);
127127

0 commit comments

Comments
 (0)