From bd0df8cc3ba938c5e50c54b1ab1ff5eae9cd268a Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Thu, 9 May 2024 13:55:54 +0200 Subject: [PATCH] run on older node Signed-off-by: Matteo Collina --- lib/generator.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/generator.ts b/lib/generator.ts index 978463e..1424fc5 100644 --- a/lib/generator.ts +++ b/lib/generator.ts @@ -5,6 +5,8 @@ import { BaseGenerator } from '@platformatic/generators' import { schema } from './schema.js' import { generateGlobalTypesFile } from './templates/types.js' import { generatePlugins } from '@platformatic/generators/lib/create-plugin.js' +import { fileURLToPath } from 'node:url' +import { dirname } from 'node:path' interface PackageJson { name: string @@ -17,6 +19,7 @@ class AiWarpGenerator extends ServiceGenerator { getDefaultConfig (): { [x: string]: BaseGenerator.JSONValue } { const defaultBaseConfig = super.getDefaultConfig() + const dir = import.meta.dirname || dirname(fileURLToPath(import.meta.url)) const defaultConfig = { aiProvider: 'openai', aiModel: 'gpt-3.5-turbo',