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() {
|
init() {
|
||||||
// Determine if we're using macOS Catalina or newer (that support /bin/zsh as default shell)
|
// 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))
|
.init(majorVersion: 10, minorVersion: 15, patchVersion: 0))
|
||||||
|
|
||||||
// If macOS Mojave is being used, we'll default to /bin/bash
|
// If macOS Mojave is being used, we'll default to /bin/bash
|
||||||
if (!supportsZsh) {
|
self.shell = at_least_10_15 ? "/bin/sh" : "/bin/bash"
|
||||||
print("You're not running macOS Catalina or newer, so defaulting to /bin/bash!")
|
print(at_least_10_15 ? "Detected recent macOS (> 10.15): defaulting to /bin/sh"
|
||||||
self.shell = "/bin/bash"
|
: "Detected older macOS (< 10.15): so defaulting to /bin/bash")
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user