diff --git a/Sources/Swiftly/Init.swift b/Sources/Swiftly/Init.swift index 0895b38c..d9c0efca 100644 --- a/Sources/Swiftly/Init.swift +++ b/Sources/Swiftly/Init.swift @@ -66,24 +66,50 @@ struct Init: SwiftlyCommand { // Give the user the prompt and the choice to abort at this point. if !assumeYes { + var msg = """ + Welcome to swiftly, the Swift toolchain manager for Linux and macOS! + + Please read the following information carefully before proceeding with the installation. If you + wish to customize the steps performed during the installation process, refer to 'swiftly init -h' + for configuration options. + + Swiftly installs files into the following locations: + + \(Swiftly.currentPlatform.swiftlyHomeDir.path) - Directory for configuration files + \(Swiftly.currentPlatform.swiftlyBinDir.path) - Links to the binaries of the active toolchain + \(Swiftly.currentPlatform.swiftlyToolchainsDir.path) - Directory hosting installed toolchains + + These locations can be changed by setting the environment variables + SWIFTLY_HOME_DIR and SWIFTLY_BIN_DIR before running 'swiftly init' again. + + """ + if !skipInstall { + msg += """ + + Once swiftly is set up, it will install the latest available Swift toolchain. This can be + suppressed with the '--skip-install' option. + """ #if os(Linux) - 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." + msg += """ + In the process, swiftly will add swift.org + GnuPG keys into your keychain to verify the integrity of the downloads. + + """ #else - let sigMsg = "" + msg += "\n" #endif - let installMsg = if !skipInstall { - "\nOnce swiftly is installed it will install the latest available swift toolchain.\(sigMsg)\n" - } else { "" } + } + if !noModifyProfile { + msg += """ - SwiftlyCore.print(""" - Swiftly will be installed into the following locations: + For your convenience, swiftly will also attempt to modify your shell's profile file to make + installed items available in your environment upon login. This can be suppressed with the + '--no-modify-profile' option. - \(Swiftly.currentPlatform.swiftlyHomeDir.path) - Data and configuration files directory including toolchains - \(Swiftly.currentPlatform.swiftlyBinDir.path) - Executables installation directory + """ + } - These locations can be changed with SWIFTLY_HOME_DIR and SWIFTLY_BIN_DIR environment variables and run this again. - \(installMsg) - """) + SwiftlyCore.print(msg) guard SwiftlyCore.promptForConfirmation(defaultBehavior: true) else { throw SwiftlyError(message: "swiftly installation has been cancelled") @@ -239,9 +265,13 @@ struct Init: SwiftlyCommand { // 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. + 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 update your + shell's environment by running + + hash -r - hash -r + or restarting your shell. """) } diff --git a/Sources/Swiftly/Install.swift b/Sources/Swiftly/Install.swift index fa32a38c..3bbb9299 100644 --- a/Sources/Swiftly/Install.swift +++ b/Sources/Swiftly/Install.swift @@ -112,10 +112,12 @@ struct Install: SwiftlyCommand { // 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. + NOTE: Swiftly has updated some elements in your path and your shell may not yet be + aware of the changes. You can update your shell's environment by running - hash -r + hash -r + + or restarting your shell. """) } diff --git a/Sources/Swiftly/Update.swift b/Sources/Swiftly/Update.swift index c7414369..2382bf43 100644 --- a/Sources/Swiftly/Update.swift +++ b/Sources/Swiftly/Update.swift @@ -137,10 +137,12 @@ struct Update: SwiftlyCommand { if pathChanged { 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. + NOTE: Swiftly has updated some elements in your path and your shell may not yet be + aware of the changes. You can update your shell's environment by running - hash -r + hash -r + + or restarting your shell. """) }