Skip to content

Commit

Permalink
[macOS] Remove embedded flasher binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark committed Apr 29, 2024
1 parent c92b7ed commit ff8b23b
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 113 deletions.
111 changes: 0 additions & 111 deletions macos/QMK Toolbox.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file removed macos/QMK Toolbox/Resources/avrdude
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/bootloadHID
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/dfu-programmer
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/dfu-util
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/hid_bootloader_cli
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/libavrdude.1.0.0.dylib
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/libftdi1.2.5.0.dylib
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/libhidapi.0.14.0.dylib
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/libusb-0.1.4.dylib
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/libusb-1.0.0.dylib
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/mdloader
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/teensy_loader_cli
Binary file not shown.
Binary file removed macos/QMK Toolbox/Resources/wb32-dfu-updater_cli
Binary file not shown.
18 changes: 16 additions & 2 deletions macos/QMK Toolbox/USB/Bootloader/BootloaderDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,26 @@ class BootloaderDevice: USBDeviceProtocol, CustomStringConvertible {

func reset(_ mcu: String) {}

func resolveHomebrewBinary(for command: String) -> URL? {
let fileManager = FileManager()
if fileManager.fileExists(atPath: "/opt/homebrew/bin/\(command)") {
return URL(fileURLWithPath: "/opt/homebrew/bin/\(command)")
} else if fileManager.fileExists(atPath: "/usr/local/bin/\(command)") {
return URL(fileURLWithPath: "/usr/local/bin/\(command)")
}
return nil
}

func runProcess(_ command: String, args: [String]) {
print(message: "\(command) \(args.joined(separator: " "))", type: .command)

guard let resolvedCommand = resolveHomebrewBinary(for: command) else {
print(message: "\(command) does not seem to be installed!", type: .error)
return
}

let task = Process()
task.executableURL = Bundle.main.url(forResource: command, withExtension: nil)
task.currentDirectoryURL = Bundle.main.resourceURL
task.executableURL = resolvedCommand
task.arguments = args

let outPipe = Pipe()
Expand Down

0 comments on commit ff8b23b

Please sign in to comment.