mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 09:28:38 +00:00
Added shell detection
This commit is contained in:
parent
d199bbd852
commit
05fda273cd
@ -78,7 +78,11 @@ class ShellScriptTouchBarItem: CustomButtonTouchBarItem {
|
|||||||
|
|
||||||
func execute(_ command: String) -> String {
|
func execute(_ command: String) -> String {
|
||||||
let task = Process()
|
let task = Process()
|
||||||
|
if let shell = getenv("SHELL") {
|
||||||
|
task.launchPath = String.init(cString: shell)
|
||||||
|
} else {
|
||||||
task.launchPath = "/bin/bash"
|
task.launchPath = "/bin/bash"
|
||||||
|
}
|
||||||
task.arguments = ["-c", command]
|
task.arguments = ["-c", command]
|
||||||
|
|
||||||
let pipe = Pipe()
|
let pipe = Pipe()
|
||||||
|
|||||||
@ -51,7 +51,11 @@ class SwipeItem: NSCustomTouchBarItem {
|
|||||||
if scriptBash != nil {
|
if scriptBash != nil {
|
||||||
DispatchQueue.shellScriptQueue.async {
|
DispatchQueue.shellScriptQueue.async {
|
||||||
let task = Process()
|
let task = Process()
|
||||||
|
if let shell = getenv("SHELL") {
|
||||||
|
task.launchPath = String.init(cString: shell)
|
||||||
|
} else {
|
||||||
task.launchPath = "/bin/bash"
|
task.launchPath = "/bin/bash"
|
||||||
|
}
|
||||||
task.arguments = ["-c", self.scriptBash!]
|
task.arguments = ["-c", self.scriptBash!]
|
||||||
task.launch()
|
task.launch()
|
||||||
task.waitUntilExit()
|
task.waitUntilExit()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user