fix(create-basic-tools): correct template path resolution for npx execution

Version @tpmjs/create-basic-tools@1.0.6

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ajax Davis 2025-12-05 09:06:52 +10:00
parent 9ff4cd6d05
commit d10257a8f4
3 changed files with 12 additions and 2 deletions

View file

@ -27,7 +27,9 @@ export async function copyTemplate(
destPath: string,
replacements?: Record<string, string>
): Promise<void> {
const templatePath = path.join(__dirname, '../../templates', templateName);
// After tsup compilation, __dirname points to dist/
// Templates are at package root, so we only need to go up one level
const templatePath = path.join(__dirname, '../templates', templateName);
let content = await fs.readFile(templatePath, 'utf-8');
// Apply replacements if provided