Skip to content

Commit 2f6bc85

Browse files
committed
List toolchain location and restructure message concatenation
1 parent d407eb0 commit 2f6bc85

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

Sources/Swiftly/Init.swift

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,33 @@ struct Init: SwiftlyCommand {
6666

6767
// Give the user the prompt and the choice to abort at this point.
6868
if !assumeYes {
69-
#if os(Linux)
70-
let sigMsg = " In the process of installing the new toolchain, swiftly will add swift.org GnuPG keys into your keychain to verify the integrity of the downloads."
71-
#else
72-
let sigMsg = ""
73-
#endif
74-
let installMsg = if !skipInstall {
75-
"\nOnce swiftly is installed it will install the latest available Swift toolchain.\(sigMsg)\n"
76-
} else { "" }
77-
78-
SwiftlyCore.print("""
79-
Swiftly will install files into the following locations:
80-
81-
\(Swiftly.currentPlatform.swiftlyHomeDir.path) - Directory for configuration files
82-
\(Swiftly.currentPlatform.swiftlyBinDir.path) - Links to the binaries of the active toolchain
83-
84-
These locations can be changed by setting the environment variables SWIFTLY_HOME_DIR and SWIFTLY_BIN_DIR before running 'swiftly init' again.
85-
\(installMsg)
86-
""")
69+
var msg = """
70+
Swiftly installs files into the following locations:
71+
72+
\(Swiftly.currentPlatform.swiftlyHomeDir.path) - Directory for configuration files
73+
\(Swiftly.currentPlatform.swiftlyBinDir.path) - Links to the binaries of the active toolchain
74+
\(Swiftly.currentPlatform.swiftlyToolchainsDir.path) - Directory hosting installed toolchains
75+
76+
These locations can be changed by setting the environment variables
77+
SWIFTLY_HOME_DIR and SWIFTLY_BIN_DIR before running 'swiftly init' again.
78+
79+
"""
80+
if !skipInstall {
81+
msg += """
82+
83+
Once swiftly is set up, it will install the latest available Swift toolchain.
84+
85+
"""
86+
#if os(Linux)
87+
msg += """
88+
In the process, swiftly will add swift.org GnuPG keys into your keychain to verify
89+
the integrity of the downloads.
90+
91+
"""
92+
#endif
93+
}
94+
95+
SwiftlyCore.print(msg)
8796

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

0 commit comments

Comments
 (0)