Skip to content

Commit f8a8dd4

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

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

Sources/LinuxPlatform/Linux.swift

+5-2
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",
@@ -392,7 +392,10 @@ public struct Linux: Platform {
392392
}
393393

394394
public func verifySignature(httpClient: SwiftlyHTTPClient, archiveDownloadURL: URL, archive: URL, verbose: Bool) async throws {
395-
SwiftlyCore.print("Downloading toolchain signature...")
395+
if verbose {
396+
SwiftlyCore.print("Downloading toolchain signature...")
397+
}
398+
396399
let sigFile = self.getTempFilePath()
397400
let _ = FileManager.default.createFile(atPath: sigFile.path, contents: nil)
398401
defer {

Sources/Swiftly/Init.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ internal struct Init: SwiftlyCommand {
8686
""")
8787

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

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

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

Sources/Swiftly/Install.swift

+11-2
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)