profile fix fit
This commit is contained in:
parent
77f7927e77
commit
f445f15336
@ -3,7 +3,7 @@ import { join, dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const DEFAULT_PROFILE_PATH = join(__dirname, '../../../../resume-generator/base.json');
|
||||
const DEFAULT_PROFILE_PATH = process.env.RESUME_PROFILE_PATH || join(__dirname, '../../../../resume-generator/base.json');
|
||||
|
||||
let cachedProfile: any = null;
|
||||
let cachedProfilePath: string | null = null;
|
||||
|
||||
@ -15,7 +15,7 @@ type ResumeProjectSelectionItem = ResumeProjectCatalogItem & { summaryText: stri
|
||||
|
||||
export async function loadResumeProfile(profilePath: string = DEFAULT_RESUME_PROFILE_PATH): Promise<unknown> {
|
||||
if (profilePath === DEFAULT_RESUME_PROFILE_PATH) {
|
||||
return getProfile();
|
||||
return getProfile(profilePath);
|
||||
}
|
||||
const content = await readFile(profilePath, 'utf-8');
|
||||
return JSON.parse(content) as unknown;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user