Skip to content

fix(dev-cli): Call mkdir before attempting to write the config file#3804

Merged
brkalow merged 1 commit intomainfrom
brk.fix/dev-cli-config-dir
Jul 24, 2024
Merged

fix(dev-cli): Call mkdir before attempting to write the config file#3804
brkalow merged 1 commit intomainfrom
brk.fix/dev-cli-config-dir

Conversation

@brkalow
Copy link
Copy Markdown
Member

@brkalow brkalow commented Jul 24, 2024

Description

Ensure the directory where we write the config file exists.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@brkalow brkalow requested a review from dstaley July 24, 2024 16:01
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jul 24, 2024

🦋 Changeset detected

Latest commit: 92ab39f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/dev-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

},
};

await mkdir(dirname(CONFIG_FILE), { recursive: true });
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should resolve successfully if it already exists for some reason:

Calling fsPromises.mkdir() when path is a directory that exists results in a rejection only when recursive is false.

Copy link
Copy Markdown
Member

@thiskevinwang thiskevinwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brkalow brkalow merged commit 87bb639 into main Jul 24, 2024
@brkalow brkalow deleted the brk.fix/dev-cli-config-dir branch July 24, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants