Skip to content

Commit

Permalink
fix: correct template path resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
damassi committed Jan 6, 2025
1 parent 8e2c51a commit 4cf0240
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/thin-clocks-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@t1mmen/srtd": patch
---

fix `register` template path resolution
6 changes: 1 addition & 5 deletions src/utils/registerTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ import fs from 'node:fs/promises';
import path from 'node:path';
import chalk from 'chalk';
import { calculateMD5 } from './calculateMD5.js';
import { getConfig } from './config.js';
import { fileExists } from './fileExists.js';
import { loadBuildLog } from './loadBuildLog.js';
import { saveBuildLog } from './saveBuildLog.js';

export async function registerTemplate(templatePath: string, baseDir: string): Promise<void> {
const config = await getConfig(baseDir);

// Try multiple path resolutions
const pathsToTry = [
path.join(baseDir, config.templateDir, templatePath), // In templates dir
path.resolve(templatePath),
];

let resolvedPath: string | null = null;
Expand Down

0 comments on commit 4cf0240

Please sign in to comment.