Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli-utils): Create directories in CLI when writing to non-existent paths #401

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

kitten
Copy link
Member

@kitten kitten commented Sep 24, 2024

Related to 0no-co/GraphQLSP#357

Summary

Creates directories recursively if the CLI is trying to write to a directory that doesn't exist yet.

The symbolic link check is a bit scuffed, but basically just protects us against creating a directory at the leaf path, if a conflicting symlink exists and points to a directory, since this will most certainly cause an issue. Otherwise, at non-leaf paths the directory would be resolved normally anyway.

Set of changes

  • Add recursive mkdir if target doesn't exist

Copy link

changeset-bot bot commented Sep 24, 2024

🦋 Changeset detected

Latest commit: f060079

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

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

@kitten kitten merged commit bce10e3 into main Sep 24, 2024
1 check passed
@kitten kitten deleted the @kitten/fix/directory-mkdirp branch September 24, 2024 11:02
@github-actions github-actions bot mentioned this pull request Sep 24, 2024
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.

2 participants