Skip to content

Commit

Permalink
Merge pull request #22644 from storybookjs/fix/windows-paths
Browse files Browse the repository at this point in the history
CLI: Account for windows paths when copying templates
  • Loading branch information
shilman committed May 22, 2023
1 parent b3d6df8 commit edc0e78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/lib/cli/src/dirs.ts
Expand Up @@ -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[] = [];

Expand Down
4 changes: 2 additions & 2 deletions code/lib/cli/src/helpers.ts
Expand Up @@ -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]);
Expand Down Expand Up @@ -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,
});
}
Expand Down

0 comments on commit edc0e78

Please sign in to comment.