Skip to content

Commit

Permalink
fix: build failure
Browse files Browse the repository at this point in the history
Signed-off-by: Hunter Achieng <[email protected]>
  • Loading branch information
hunterachieng authored and mtuchi committed Mar 19, 2024
1 parent c865ce1 commit 026505b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 74 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
"@openfn/simple-ast": "0.4.1",
"eslint": "8.26.0"
}
}
}
102 changes: 31 additions & 71 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions tools/generate/src/generate-adaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ const generateAdaptor = async (adaptorName: string) => {
await copyAndRename(templatePath, adaptorPath, adaptorName);
console.log(`Adaptor "${adaptorName}" created successfully.`);
console.log(
`Reminder: Please change the assets 🖼️ for your new adaptor "${adaptorName}".`
`Reminder: Change the assets 🖼️ for your new adaptor "${adaptorName}".`
);
console.log(`Reminder: Run "pnpm install" to install your packages.`);
};

const fileMap = { package_json: 'package.json' };

const copyAndRename = async (
source: string,
target: string,
Expand All @@ -39,7 +42,7 @@ const copyAndRename = async (

const targetPath = path.join(
target,
item.name.replace('template', adaptorName)
fileMap[item.name] ?? item.name.replace('template', adaptorName)
);

if (item.isDirectory()) {
Expand All @@ -48,6 +51,7 @@ const copyAndRename = async (
} else if (item.isFile()) {
let content = await fs.readFile(sourcePath, 'utf8');
content = content.replace(/{{TEMPLATE}}/g, adaptorName);

await fs.writeFile(targetPath, content);
}
}
Expand Down
File renamed without changes.

0 comments on commit 026505b

Please sign in to comment.