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

[SR-15719] func writeFileContents(path:,bytes:) should have an option to create the parent directory #4361

Open
abertelrud opened this issue Jan 11, 2022 · 1 comment
Labels

Comments

@abertelrud
Copy link
Contributor

Previous ID SR-15719
Radar None
Original Reporter @abertelrud
Type Task
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Task
Assignee None
Priority Medium

md5: 9052552b66dd7ea15028217d415b5f1f

Issue Description:

A lot of the SwiftPM unit tests use the ToolsSupportCore method `writeFileContents(_ path: AbsolutePath, body: (WritableByteStream) -> Void) throws`, which conveniently creates the parent directory of the file if needed.

But the core funnel method `func writeFileContents(_ path: AbsolutePath, bytes: ByteString)` does not have a way of creating the directory.

It would be useful to be able to create the directory from any of the variants of `func writeFileContents(_ path: AbsolutePath, bytes: ByteString)`, so this SR suggest adding a parameter to do that. It probably needs to default to false for compatibility, but that can be discussed.

@abertelrud
Copy link
Contributor Author

See also #4002 (comment)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants