-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Process: .currentDirectoryURL and .executableURL fixes #2525
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
Process: .currentDirectoryURL and .executableURL fixes #2525
Conversation
@swift-ci test |
442a0ab
to
49f825e
Compare
@swift-ci test |
1 similar comment
@swift-ci test |
- currentDirectoryURL should be of type URL? - Disallow setting either property to nil or a non-File URL, to match Darwin. - Dont set PWD environment variable, it should just be copied from the current environment, to match Darwin.
49f825e
to
2427fb2
Compare
@swift-ci test |
1 similar comment
@swift-ci test |
get { _executable } | ||
set { | ||
guard let url = newValue, url.isFileURL else { | ||
fatalError("must provide a launch path") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is fatalError
correct? Should this not be an exception of sorts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Darwin throws NSException
so fatalError
is the swift equivalent. Also it is a property so nothing else that could be done anyway.
get { _currentDirectoryURL } | ||
set { | ||
guard let url = newValue, url.isFileURL else { | ||
fatalError("non-file URL argument") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
@swift-ci test and merge |
1 similar comment
@swift-ci test and merge |
I think that this breaks the Windows build:
https://dev.azure.com/compnerd/3133d6ab-80a8-4996-ac4f-03df25cd3224/_apis/build/builds/12302/logs/95 |
@compnerd That's annoying, I will sort out a fix. I just realised I need to add an extra test for when |
currentDirectoryURL should be of type URL?
Disallow setting either property to nil or a non-File URL,
to match Darwin.
Dont set PWD environment variable, it should just be copied from the
current environment, to match Darwin.