From 9706d7ebec243a58653e944ba7b4d1b9d550df99 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Fri, 19 May 2023 18:43:58 +0200 Subject: [PATCH] account for windows paths when copying templates --- code/lib/cli/src/dirs.ts | 2 +- code/lib/cli/src/helpers.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/lib/cli/src/dirs.ts b/code/lib/cli/src/dirs.ts index 6f3fa0e06864..1dfc1045b6f5 100644 --- a/code/lib/cli/src/dirs.ts +++ b/code/lib/cli/src/dirs.ts @@ -38,7 +38,7 @@ export async function getRendererDir( const frameworkPackageName = externalFramework?.renderer || externalFramework?.packageName || `@storybook/${renderer}`; - const packageJsonPath = `${frameworkPackageName}/package.json`; + const packageJsonPath = join(frameworkPackageName, 'package.json'); const errors: Error[] = []; diff --git a/code/lib/cli/src/helpers.ts b/code/lib/cli/src/helpers.ts index a1e162a3d263..f928fe2c9983 100644 --- a/code/lib/cli/src/helpers.ts +++ b/code/lib/cli/src/helpers.ts @@ -211,7 +211,7 @@ export async function copyTemplateFiles({ }; const templatePath = async () => { const baseDir = await getRendererDir(packageManager, renderer); - const assetsDir = join(baseDir, 'template/cli'); + const assetsDir = join(baseDir, 'template', 'cli'); const assetsLanguage = join(assetsDir, languageFolderMapping[language]); const assetsJS = join(assetsDir, languageFolderMapping[SupportedLanguage.JAVASCRIPT]); @@ -250,7 +250,7 @@ export async function copyTemplateFiles({ const destinationPath = destination ?? (await targetPath()); if (includeCommonAssets) { - await fse.copy(join(getCliDir(), 'rendererAssets/common'), destinationPath, { + await fse.copy(join(getCliDir(), 'rendererAssets', 'common'), destinationPath, { overwrite: true, }); }