Skip to content

Commit 973c443

Browse files
committed
✨ Initialiser now adds a motion folder
1 parent 8235a17 commit 973c443

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/initializer/src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,19 @@ function main(packageName: string, version: string) {
2020
const codemodBasePath = `${communityDirectoryPath}/${safePackageName}`;
2121
const codemodPath = `${codemodBasePath}/${version}`;
2222
const configPath = `${codemodBasePath}/codeshift.config.js`;
23-
const testPath = `${codemodPath}/_tests_`;
23+
const testsPath = `${codemodPath}/_tests_`;
24+
const motionsPath = `${codemodPath}/motions`;
2425

2526
fs.mkdirSync(codemodPath, { recursive: true });
26-
fs.copySync(`${__dirname}/../template/_tests_`, testPath);
27+
fs.copySync(`${__dirname}/../template/motions`, motionsPath);
28+
fs.copySync(`${__dirname}/../template/_tests_`, testsPath);
2729

2830
const testFile = fs
29-
.readFileSync(`${testPath}/transform.spec.ts`, 'utf8')
31+
.readFileSync(`${testsPath}/transform.spec.ts`, 'utf8')
3032
.replace('<% packageName %>', packageName)
3133
.replace('<% version %>', version);
3234

33-
fs.writeFileSync(`${testPath}/transform.spec.ts`, testFile);
35+
fs.writeFileSync(`${testsPath}/transform.spec.ts`, testFile);
3436

3537
if (!fs.existsSync(configPath)) {
3638
fs.writeFileSync(

packages/initializer/template/motions/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)