Skip to content

Commit

Permalink
default error source to process.cwd if require is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondill committed Feb 3, 2023
1 parent 69a87e3 commit c5043ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export function printCommand(...commands: string[]) {

/** @see https://github.com/uetchy/create-create-app */
export async function create(appName: string, options: Options) {
epicfail(require.main!.filename, {
epicfail(require?.main?.filename ?? process.cwd(), {
assertExpected: (err) => err.name === 'CLIError',
});

Expand Down

0 comments on commit c5043ae

Please sign in to comment.