-
Notifications
You must be signed in to change notification settings - Fork 49
Do not move symlink swiftly into the bin directory #365
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
Do not move symlink swiftly into the bin directory #365
Conversation
@swift-ci test macOS |
Sources/SwiftlyCore/Platform.swift
Outdated
} | ||
} | ||
|
||
guard case let cmdAbsolute else { fatalError() } |
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.
nit: this guard looks redundant, as the code does not allow for cmdAbsolute
to be optional after guard var cmdAbsolute
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.
The idea is to tighten the var into a let. Perhaps there is a better way to lock the variable down?
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.
This code has changed into a different approach and loses this guard statement.
Sources/SwiftlyCore/Platform.swift
Outdated
return | ||
} | ||
|
||
// Traverse a symbolic link to the real swiftly |
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.
An addition to the comment here explaining why this block might be hit would help; its unclear how swiftly would get in to this situation just from the code.
@swift-ci test macOS |
@swift-ci test macOS |
Sources/SwiftlyCore/Platform.swift
Outdated
@@ -373,10 +373,17 @@ extension Platform { | |||
|
|||
// We couldn't find ourselves in the usual places. Assume that no installation is necessary | |||
// since we were most likely invoked at SWIFTLY_BIN_DIR already. | |||
guard let cmdAbsolute else { | |||
guard var cmdAbsolute else { |
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.
The code is must simpler now; this can be changed back to let and the guard case let cmdAbsolute = cmdAbsolute else { fatalError() }
can be removed completely
@swift-ci test macOS |
If the swiftly that we've found is a symbolic link then there is likely a
sophisticated installation of it, such as with homebrew. Don't copy
that symbolic link to the bin directory in this case, and allow the
external manager to manage swiftly upgrades on its own.