1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 20:10:08 +02:00

👌 Cleanup

This commit is contained in:
2021-02-19 18:59:39 +01:00
parent e4096ab662
commit 11d74277e5

View File

@ -25,14 +25,13 @@ class Shell {
init() {
// Determine if we're using macOS Catalina or newer (that support /bin/zsh as default shell)
let supportsZsh = ProcessInfo.processInfo.isOperatingSystemAtLeast(
let at_least_10_15 = ProcessInfo.processInfo.isOperatingSystemAtLeast(
.init(majorVersion: 10, minorVersion: 15, patchVersion: 0))
// If macOS Mojave is being used, we'll default to /bin/bash
if (!supportsZsh) {
print("You're not running macOS Catalina or newer, so defaulting to /bin/bash!")
self.shell = "/bin/bash"
}
self.shell = at_least_10_15 ? "/bin/sh" : "/bin/bash"
print(at_least_10_15 ? "Detected recent macOS (> 10.15): defaulting to /bin/sh"
: "Detected older macOS (< 10.15): so defaulting to /bin/bash")
}
/**