Skip to content

[Collections] Better handling of spaces in collection file path #3412

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

Merged
merged 1 commit into from
Apr 20, 2021

Conversation

yim-lee
Copy link
Contributor

@yim-lee yim-lee commented Apr 17, 2021

Motivation:
Try adding a local package collection file with space(s) in the filename and it would result in error "Error: Invalid argument 'collectionUrl'".

Modifications:
In case URL(string:) fails, try URL(fileURLWithPath:) if the path starts with file://. This initializer escapes whitespaces appropriately.

rdar://76732268

Motivation:
Try adding a local package collection file with space(s) in the filename and it would result in error "Error: Invalid argument 'collectionUrl'".

Modifications:
In case `URL(string:)` fails, try `URL(fileURLWithPath:)` if the path starts with `file://`. This initializer escapes whitespaces appropriately.

rdar://76732268
@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 17, 2021

@swift-ci please smoke test

@tomerd
Copy link
Contributor

tomerd commented Apr 19, 2021

@yim-lee make sure to create a matching PR for release/5.5 branch as well once merged

@yim-lee yim-lee merged commit 2b9a29f into swiftlang:main Apr 20, 2021
@yim-lee yim-lee deleted the space-path branch April 20, 2021 19:29
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Apr 20, 2021
…tlang#3412)

Motivation:
Try adding a local package collection file with space(s) in the filename and it would result in error "Error: Invalid argument 'collectionUrl'".

Modifications:
In case `URL(string:)` fails, try `URL(fileURLWithPath:)` if the path starts with `file://`. This initializer escapes whitespaces appropriately.

rdar://76732268
yim-lee added a commit that referenced this pull request Apr 22, 2021
… (#3419)

Motivation:
Try adding a local package collection file with space(s) in the filename and it would result in error "Error: Invalid argument 'collectionUrl'".

Modifications:
In case `URL(string:)` fails, try `URL(fileURLWithPath:)` if the path starts with `file://`. This initializer escapes whitespaces appropriately.

rdar://76732268
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