From 6babff72ba60a2231cfc751ebc842c1f04cc3c7d Mon Sep 17 00:00:00 2001 From: Mutahhir Hayat Date: Tue, 11 Jul 2023 10:38:03 +0200 Subject: [PATCH] chore: use the right paths --- packages/cdktf-cli/src/bin/cmds/handlers.ts | 2 +- packages/cdktf-cli/src/bin/cmds/helper/init-templates.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/cdktf-cli/src/bin/cmds/handlers.ts b/packages/cdktf-cli/src/bin/cmds/handlers.ts index 88f74b87eb..1f30713ad7 100644 --- a/packages/cdktf-cli/src/bin/cmds/handlers.ts +++ b/packages/cdktf-cli/src/bin/cmds/handlers.ts @@ -113,7 +113,7 @@ export async function convert({ language, provider, stack }: any) { process.chdir(tempDir); const projectRoot = projectRootPath(); - const dist = path.resolve(projectRoot, "./dist"); + const dist = path.resolve(projectRoot, "../../dist"); logger.setLevel("ERROR"); await init({ diff --git a/packages/cdktf-cli/src/bin/cmds/helper/init-templates.ts b/packages/cdktf-cli/src/bin/cmds/helper/init-templates.ts index 4296299b4e..08997c4876 100644 --- a/packages/cdktf-cli/src/bin/cmds/helper/init-templates.ts +++ b/packages/cdktf-cli/src/bin/cmds/helper/init-templates.ts @@ -4,7 +4,14 @@ import * as fs from "fs-extra"; import * as path from "path"; import { projectRootPath } from "./utilities"; -export const templatesDir = path.join(projectRootPath(), "templates"); +export const templatesDir = path.join( + projectRootPath(), + "..", + "@cdktf", + "cli-core", + "templates" +); + const availableTemplates = fs .readdirSync(templatesDir) .filter((x) => !x.startsWith("."));