diff --git a/phpmon/Domain/Terminal/Shell.swift b/phpmon/Domain/Terminal/Shell.swift index aeb5de5..fb82968 100644 --- a/phpmon/Domain/Terminal/Shell.swift +++ b/phpmon/Domain/Terminal/Shell.swift @@ -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( - .init(majorVersion: 10,minorVersion: 15,patchVersion: 0)) + 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") } /**