Skip to content

Commit

Permalink
Improve macOS version checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankk2308 committed Jun 27, 2020
1 parent e8ab023 commit 91dc637
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tbt-flash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Author(s): Mayank Kumar (mayankk2308, github.com / mac_editor, egpu.io)
# Asutosh Palai (asutoshpalai, github.com)
# License: Specified in LICENSE.md.
# Version: 1.0.3
# Version: 1.0.4

# ----- Environment

Expand Down Expand Up @@ -32,7 +32,7 @@ is_bin_call=0
call_script_file=""

# Script version
script_major_ver="1" && script_minor_ver="0" && script_patch_ver="3"
script_major_ver="1" && script_minor_ver="0" && script_patch_ver="4"
script_ver="${script_major_ver}.${script_minor_ver}.${script_patch_ver}"
latest_script_data=""
latest_release_dwld=""
Expand Down Expand Up @@ -258,7 +258,7 @@ check_sip() {

### Set ThorUtil.efi location appropriately
set_thorutil_loc() {
if (( ${macos_major_ver} == 15 && ${macos_minor_ver} < 5 )); then
if (( ${macos_leap_ver} == 10 && ${macos_major_ver} == 15 && ${macos_minor_ver} < 5 )); then
thorutil_loc="/System/Library/AccessoryUpdaterBundles/ThunderboltAccessoryFirmwareUpdater.bundle/Contents/Resources/ThorUtil.efi"
else
thorutil_loc="/System/Library/PrivateFrameworks/MobileAccessoryUpdater.framework/XPCServices/ThunderboltAccessoryUpdaterService.xpc/Contents/Resources/ThorUtil.efi"
Expand All @@ -267,8 +267,10 @@ set_thorutil_loc() {

### macOS compatibility check
check_macos_version() {
macos_leap_ver="$(printfn "${macos_ver}" | cut -d '.' -f1)"
macos_major_ver="$(printfn "${macos_ver}" | cut -d '.' -f2)"
macos_minor_ver="$(printfn "${macos_ver}" | cut -d '.' -f3)"
[[ -z "${macos_minor_ver}" ]] && macos_minor_ver=0
[[ (${macos_major_ver} < 15) ]] && printfn "\n${bold}macOS 10.15 or later${normal} required.\n" && exit
}

Expand Down Expand Up @@ -494,7 +496,7 @@ uninstall() {
### Donations
donate() {
open "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mayankk2308@icloud.com&lc=US&item_name=Development%20of%20TBTFlash&no_note=0&currency_code=USD&bn=PP-DonationsBF:btn_donate_SM.gif:NonHostedGuest"
printfn "See your ${bold}web browser${normal}."
printfn "See your ${bold}web browser${normal}."
}

# ----- User Interface
Expand All @@ -516,5 +518,4 @@ begin() {
present_menu
}

begin
)
begin)

0 comments on commit 91dc637

Please sign in to comment.