Skip to content

Commit

Permalink
fix: fix import path of postSetup on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dziraf committed Dec 6, 2023
1 parent 8cf3c32 commit 2555452
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/commands/create/handlers/LibrarySetup.handler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import fs from 'fs/promises';
import * as URL from 'url';

import { copy } from 'fs-extra/esm';
import chalk from 'chalk';
Expand Down Expand Up @@ -52,7 +53,9 @@ export class LibrarySetupHandler extends BaseCommandHandler<CreateCommandInput>

try {
const initImport = await import(
path.join(templatesDir(), this.libraryType, this.libraryName, SCRIPTS_DIR_NAME, scriptName),
URL.pathToFileURL(
path.join(templatesDir(), this.libraryType, this.libraryName, SCRIPTS_DIR_NAME, scriptName),
).toString()
);

if (initImport?.default) {
Expand Down

0 comments on commit 2555452

Please sign in to comment.