Skip to content

Remove rehashing instructions when using the fish shell (#250) #252

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
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Sources/LinuxPlatform/Linux.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public struct Linux: Platform {
]
case "debian12":
[
"binutils-gold",
"binutils",
"libicu-dev",
"libcurl4-openssl-dev",
"libedit-dev",
Expand Down Expand Up @@ -392,7 +392,10 @@ public struct Linux: Platform {
}

public func verifySignature(httpClient: SwiftlyHTTPClient, archiveDownloadURL: URL, archive: URL, verbose: Bool) async throws {
SwiftlyCore.print("Downloading toolchain signature...")
if verbose {
SwiftlyCore.print("Downloading toolchain signature...")
}

let sigFile = self.getTempFilePath()
let _ = FileManager.default.createFile(atPath: sigFile.path, contents: nil)
defer {
Expand Down
5 changes: 3 additions & 2 deletions Sources/Swiftly/Init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ internal struct Init: SwiftlyCommand {
""")

guard SwiftlyCore.promptForConfirmation(defaultBehavior: true) else {
throw SwiftlyError(message: "Swiftly installation has been cancelled")
throw SwiftlyError(message: "swiftly installation has been cancelled")
}
}

Expand Down Expand Up @@ -250,7 +250,8 @@ internal struct Init: SwiftlyCommand {
""")
}

if pathChanged && !quietShellFollowup {
// Fish doesn't have path caching, so this might only be needed for bash/zsh
if pathChanged && !quietShellFollowup && !shell.hasSuffix("fish") {
SwiftlyCore.print("""
Your shell caches items on your path for better performance. Swiftly has added items to your path that may not get picked up right away. You can run this command to update your shell to get these items.

Expand Down
13 changes: 11 additions & 2 deletions Sources/Swiftly/Install.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,14 @@ struct Install: SwiftlyCommand {
assumeYes: self.root.assumeYes
)

if pathChanged {
let shell = if let s = ProcessInfo.processInfo.environment["SHELL"] {
s
} else {
try await Swiftly.currentPlatform.getShell()
}

// Fish doesn't cache its path, so this instruction is not necessary.
if pathChanged && !shell.hasSuffix("fish") {
SwiftlyCore.print("""
NOTE: We have updated some elements in your path and your shell may not yet be
aware of the changes. You can run this command to update your shell.
Expand Down Expand Up @@ -271,7 +278,9 @@ struct Install: SwiftlyCommand {
}
}

SwiftlyCore.print("Setting up toolchain proxies...")
if verbose {
SwiftlyCore.print("Setting up toolchain proxies...")
}

let proxiesToCreate = Set(toolchainBinDirContents).subtracting(swiftlyBinDirContents).union(overwrite)

Expand Down