Skip to content

Commit 400e6a9

Browse files
authored
Remove rehashing instructions when using the fish shell (#250)
Change Debian 12 binutils-gold virtual package to binutils Move some progress indications under verbose flag for shorter default install log
1 parent 222d5da commit 400e6a9

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

Sources/LinuxPlatform/Linux.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public struct Linux: Platform {
205205
]
206206
case "debian12":
207207
[
208-
"binutils-gold",
208+
"binutils",
209209
"libicu-dev",
210210
"libcurl4-openssl-dev",
211211
"libedit-dev",
@@ -398,7 +398,10 @@ public struct Linux: Platform {
398398
}
399399

400400
public func verifySignature(httpClient: SwiftlyHTTPClient, archiveDownloadURL: URL, archive: URL, verbose: Bool) async throws {
401-
SwiftlyCore.print("Downloading toolchain signature...")
401+
if verbose {
402+
SwiftlyCore.print("Downloading toolchain signature...")
403+
}
404+
402405
let sigFile = self.getTempFilePath()
403406
let _ = FileManager.default.createFile(atPath: sigFile.path, contents: nil)
404407
defer {

Sources/Swiftly/Init.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ internal struct Init: SwiftlyCommand {
8585
""")
8686

8787
guard SwiftlyCore.promptForConfirmation(defaultBehavior: true) else {
88-
throw SwiftlyError(message: "Swiftly installation has been cancelled")
88+
throw SwiftlyError(message: "swiftly installation has been cancelled")
8989
}
9090
}
9191

@@ -249,7 +249,8 @@ internal struct Init: SwiftlyCommand {
249249
""")
250250
}
251251

252-
if pathChanged && !quietShellFollowup {
252+
// Fish doesn't have path caching, so this might only be needed for bash/zsh
253+
if pathChanged && !quietShellFollowup && !shell.hasSuffix("fish") {
253254
SwiftlyCore.print("""
254255
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.
255256

Sources/Swiftly/Install.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,14 @@ struct Install: SwiftlyCommand {
103103
assumeYes: self.root.assumeYes
104104
)
105105

106-
if pathChanged {
106+
let shell = if let s = ProcessInfo.processInfo.environment["SHELL"] {
107+
s
108+
} else {
109+
try await Swiftly.currentPlatform.getShell()
110+
}
111+
112+
// Fish doesn't cache its path, so this instruction is not necessary.
113+
if pathChanged && !shell.hasSuffix("fish") {
107114
SwiftlyCore.print("""
108115
NOTE: We have updated some elements in your path and your shell may not yet be
109116
aware of the changes. You can run this command to update your shell.
@@ -271,7 +278,9 @@ struct Install: SwiftlyCommand {
271278
}
272279
}
273280

274-
SwiftlyCore.print("Setting up toolchain proxies...")
281+
if verbose {
282+
SwiftlyCore.print("Setting up toolchain proxies...")
283+
}
275284

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

0 commit comments

Comments
 (0)