diff --git a/Sources/SwiftlyCore/Platform.swift b/Sources/SwiftlyCore/Platform.swift index 1c4ee2dd..c54e393a 100644 --- a/Sources/SwiftlyCore/Platform.swift +++ b/Sources/SwiftlyCore/Platform.swift @@ -67,13 +67,11 @@ extension Platform { /// /// If a mocked home directory is set, this will be the "bin" subdirectory of the home directory. /// If not, this will be the SWIFTLY_BIN_DIR environment variable if set. If that's also unset, - /// this will default to ~/.local/bin. + /// this will default to /usr/local/bin. public var swiftlyBinDir: URL { - SwiftlyCore.mockedHomeDir.map { $0.appendingPathComponent("bin", isDirectory: true) } - ?? ProcessInfo.processInfo.environment["SWIFTLY_BIN_DIR"].map { URL(fileURLWithPath: $0) } - ?? FileManager.default.homeDirectoryForCurrentUser - .appendingPathComponent(".local", isDirectory: true) - .appendingPathComponent("bin", isDirectory: true) + SwiftlyCore.mockedHomeDir.map { $0.appendingPathComponent("bin", isDirectory: true) } ?? + ProcessInfo.processInfo.environment["SWIFTLY_BIN_DIR"].map { URL(fileURLWithPath: $0) } ?? + URL(fileURLWithPath: "/usr/local/bin") } /// The "toolchains" subdirectory of swiftly's home directory. Contains the Swift toolchains managed by swiftly. diff --git a/install/swiftly-install.sh b/install/swiftly-install.sh index 0b0a274a..59275a9e 100755 --- a/install/swiftly-install.sh +++ b/install/swiftly-install.sh @@ -4,7 +4,7 @@ # Script used to install and configure swiftly. # # This script will download the latest released swiftly executable and install it -# to $SWIFTLY_BIN_DIR, or ~/.local/bin if that variable isn't specified. +# to $SWIFTLY_BIN_DIR, or /usr/local/bin if that variable isn't specified. # # This script will also create a directory at $SWIFTLY_HOME_DIR, or # $XDG_DATA_HOME/swiftly if that variable isn't specified. If XDG_DATA_HOME is also unset, @@ -161,7 +161,7 @@ echo "" DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}" DEFAULT_HOME_DIR="$DATA_DIR/swiftly" HOME_DIR="${SWIFTLY_HOME_DIR:-$DEFAULT_HOME_DIR}" -DEFAULT_BIN_DIR="$HOME/.local/bin" +DEFAULT_BIN_DIR="/usr/local/bin" BIN_DIR="${SWIFTLY_BIN_DIR:-$DEFAULT_BIN_DIR}" while [ -z "$DISABLE_CONFIRMATION" ]; do