From 11d74277e57d7bcfcc8e0ef4a0346e9bd0fb8812 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Fri, 19 Feb 2021 18:59:39 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20Cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpmon/Domain/Terminal/Shell.swift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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") } /**