Skip to content

Commit 0f1aa94

Browse files
Polish welcome msg for release 1.0 branch (#288)
* List toolchain location and restructure message concatenation * Add introduction * Mention modification of profile Co-authored-by: Danny Mösch <[email protected]>
1 parent 26200fe commit 0f1aa94

File tree

3 files changed

+54
-20
lines changed

3 files changed

+54
-20
lines changed

Sources/Swiftly/Init.swift

+44-14
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,50 @@ internal struct Init: SwiftlyCommand {
6565

6666
// Give the user the prompt and the choice to abort at this point.
6767
if !assumeYes {
68+
var msg = """
69+
Welcome to swiftly, the Swift toolchain manager for Linux and macOS!
70+
71+
Please read the following information carefully before proceeding with the installation. If you
72+
wish to customize the steps performed during the installation process, refer to 'swiftly init -h'
73+
for configuration options.
74+
75+
Swiftly installs files into the following locations:
76+
77+
\(Swiftly.currentPlatform.swiftlyHomeDir.path) - Directory for configuration files
78+
\(Swiftly.currentPlatform.swiftlyBinDir.path) - Links to the binaries of the active toolchain
79+
\(Swiftly.currentPlatform.swiftlyToolchainsDir.path) - Directory hosting installed toolchains
80+
81+
These locations can be changed by setting the environment variables
82+
SWIFTLY_HOME_DIR and SWIFTLY_BIN_DIR before running 'swiftly init' again.
83+
84+
"""
85+
if !skipInstall {
86+
msg += """
87+
88+
Once swiftly is set up, it will install the latest available Swift toolchain. This can be
89+
suppressed with the '--skip-install' option.
90+
"""
6891
#if os(Linux)
69-
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."
92+
msg += """
93+
In the process, swiftly will add swift.org
94+
GnuPG keys into your keychain to verify the integrity of the downloads.
95+
96+
"""
7097
#else
71-
let sigMsg = ""
98+
msg += "\n"
7299
#endif
73-
let installMsg = if !skipInstall {
74-
"\nOnce swiftly is installed it will install the latest available swift toolchain.\(sigMsg)\n"
75-
} else { "" }
100+
}
101+
if !noModifyProfile {
102+
msg += """
76103
77-
SwiftlyCore.print("""
78-
Swiftly will be installed into the following locations:
104+
For your convenience, swiftly will also attempt to modify your shell's profile file to make
105+
installed items available in your environment upon login. This can be suppressed with the
106+
'--no-modify-profile' option.
79107
80-
\(Swiftly.currentPlatform.swiftlyHomeDir.path) - Data and configuration files directory including toolchains
81-
\(Swiftly.currentPlatform.swiftlyBinDir.path) - Executables installation directory
108+
"""
109+
}
82110

83-
These locations can be changed with SWIFTLY_HOME_DIR and SWIFTLY_BIN_DIR environment variables and run this again.
84-
\(installMsg)
85-
""")
111+
SwiftlyCore.print(msg)
86112

87113
guard SwiftlyCore.promptForConfirmation(defaultBehavior: true) else {
88114
throw SwiftlyError(message: "swiftly installation has been cancelled")
@@ -238,9 +264,13 @@ internal struct Init: SwiftlyCommand {
238264
// Fish doesn't have path caching, so this might only be needed for bash/zsh
239265
if pathChanged && !quietShellFollowup && !shell.hasSuffix("fish") {
240266
SwiftlyCore.print("""
241-
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.
267+
Your shell caches items on your path for better performance. Swiftly has added
268+
items to your path that may not get picked up right away. You can update your
269+
shell's environment by running
270+
271+
hash -r
242272
243-
hash -r
273+
or restarting your shell.
244274
245275
""")
246276
}

Sources/Swiftly/Install.swift

+5-3
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ struct Install: SwiftlyCommand {
112112
// Fish doesn't cache its path, so this instruction is not necessary.
113113
if pathChanged && !shell.hasSuffix("fish") {
114114
SwiftlyCore.print("""
115-
NOTE: We have updated some elements in your path and your shell may not yet be
116-
aware of the changes. You can run this command to update your shell.
115+
NOTE: Swiftly has updated some elements in your path and your shell may not yet be
116+
aware of the changes. You can update your shell's environment by running
117117
118-
hash -r
118+
hash -r
119+
120+
or restarting your shell.
119121
120122
""")
121123
}

Sources/Swiftly/Update.swift

+5-3
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,12 @@ struct Update: SwiftlyCommand {
137137

138138
if pathChanged {
139139
SwiftlyCore.print("""
140-
NOTE: We have updated some elements in your path and your shell may not yet be
141-
aware of the changes. You can run this command to update your shell.
140+
NOTE: Swiftly has updated some elements in your path and your shell may not yet be
141+
aware of the changes. You can update your shell's environment by running
142142
143-
hash -r
143+
hash -r
144+
145+
or restarting your shell.
144146
145147
""")
146148
}

0 commit comments

Comments
 (0)