mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 04:20:07 +02:00
👌 Cleanup
This commit is contained in:
@ -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")
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user