Skip to content

Commit

Permalink
Pass firmware version to the script.
Browse files Browse the repository at this point in the history
  • Loading branch information
kirb committed Apr 3, 2021
1 parent c26b9bf commit c9460cf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Betelguese/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ class ViewController: NSViewController {

URLSession.shared.downloadTask(with: URL(string: "https://taurine.app/docs/betelguese.sh")!) { (url, response, error) in
if error != nil {
NSLog("response = %@", String(describing: response))
NSLog("error = %@", error! as NSError)
DispatchQueue.main.async {
NSAlert(error: error!).beginSheetModal(for: self.view.window!, completionHandler: nil)
self.stopDoingStuff()
Expand All @@ -142,11 +140,12 @@ class ViewController: NSViewController {
}

let scriptData = try! Data(contentsOf: url!)
let firmware = MobileDeviceHelper.deviceFirmware ?? "0"

let path = ProcessInfo.processInfo.environment["PATH"]! + ":" + Bundle.main.resourcePath!
let process = Process()
process.launchPath = "/bin/bash"
process.arguments = [ "/dev/stdin", "-y" ]
process.arguments = [ "/dev/stdin", "-y", firmware ]
process.environment = [
"PATH": path,
"SSHPASS": "alpine"
Expand Down

0 comments on commit c9460cf

Please sign in to comment.