Skip to content

Commit

Permalink
Make sure a bad download script doesn't crash the whole app.
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgio Calderolla committed Oct 22, 2021
1 parent 05ffc8b commit 209e6ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Catch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 783;
CURRENT_PROJECT_VERSION = 786;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -788,7 +788,7 @@
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 783;
CURRENT_PROJECT_VERSION = 786;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down
12 changes: 11 additions & 1 deletion Sources/App/Scripts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ extension Process {
}
}
}
script.launch()

if #available(macOS 10.13, *) {
do {
try script.run()
} catch {
os_log("Couldn't run script: %{public}@", log: .main, type: .error, error.localizedDescription)
completion?(false)
}
} else {
script.launch()
}
}
}
}

0 comments on commit 209e6ba

Please sign in to comment.