vulgo / ga-h97n-wifi-hackintosh

macOS 12 Monterey on H97N-WIFI + OpenCore
24 stars 5 forks source link

Cannot compile "usbtool.command" on Xcode 12.4 #22

Closed Ramel closed 2 years ago

Ramel commented 2 years ago

Facing an error in BigSur Xcode 12.4 with the "usbtool.command", I've modified the involved line:

usbtool.command | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usbtool.command b/usbtool.command
index b8035f7..919e144 100755
--- a/usbtool.command
+++ b/usbtool.command
@@ -175,7 +175,7 @@ let kInfoPlistSourceDictionary: [String: Any] = {
    """

    do {
-       guard let data: Data = .init(base64Encoded: sourceData, options: .ignoreUnknownCharacters) else {
+       guard let data = Data(base64Encoded: sourceData, options: [.ignoreUnknownCharacters]) else {
            throw USBTool.RuntimeError("failed to decode property list data from base64")
        }

--

And it seems to have worked!

vulgo commented 2 years ago

You are correct according to the Apple's documentation

developer.apple.com/documentation/foundation/data/3126625-init

I must have wrongly assumed Swift Data had a variadic implementation or the parameter was or-able or something. Maybe in some compiler versions but we will go with the documentation and your code.

Are you going to make a pull request or shall I update the file, it also exists here

Ramel commented 2 years ago

As I'm not very friendly with Xcode, I'm glad that my patch proposal is correct!

So I prefer you update the file on your own.

Thanks for your repo.

vulgo commented 2 years ago

I'll update according to your patch then. Thanks @Ramel.