Kaynağa Gözat

Merge pull request #281 from loopandlearn/macCatalyst-no-expiration-msg

Mac catalyst no expiration msg
Marion Barker 2 yıl önce
ebeveyn
işleme
09a00af60e

+ 15 - 5
LoopFollow/ViewControllers/SettingsViewController.swift

@@ -98,7 +98,7 @@ class SettingsViewController: FormViewController {
        if isTestFlightBuild() {
        if isTestFlightBuild() {
           expirationHeaderString = "Beta (TestFlight) Expiration"
           expirationHeaderString = "Beta (TestFlight) Expiration"
        }
        }
-                        
+       
         form
         form
         +++ Section(header: "Data Settings", footer: "")
         +++ Section(header: "Data Settings", footer: "")
        <<< SegmentedRow<String>("units") { row in
        <<< SegmentedRow<String>("units") { row in
@@ -288,13 +288,23 @@ class SettingsViewController: FormViewController {
         }
         }
 
 
        +++ Section(header: getAppVersion(), footer: "")
        +++ Section(header: getAppVersion(), footer: "")
-
-       +++ Section(header: expirationHeaderString, footer: String(expiration.description))
-
-        showHideNSDetails()
+       
+       if !isMacApp() {
+           form +++ Section(header: expirationHeaderString, footer: String(expiration.description))
+       }
+       
+       showHideNSDetails()
        checkNightscoutStatus()
        checkNightscoutStatus()
     }
     }
     
     
+    func isMacApp() -> Bool {
+#if targetEnvironment(macCatalyst)
+        return true
+#else
+        return false
+#endif
+    }
+
     func getAppVersion() -> String {
     func getAppVersion() -> String {
         if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
         if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
             return "App Version: \(version)"
             return "App Version: \(version)"

+ 6 - 7
Scripts/capture-build-details.sh

@@ -10,11 +10,10 @@ info_plist_path="${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/BuildDetails.plis
 
 
 # Ensure the path to BuildDetails.plist is valid.
 # Ensure the path to BuildDetails.plist is valid.
 if [ "${info_plist_path}" == "/" -o ! -e "${info_plist_path}" ]; then
 if [ "${info_plist_path}" == "/" -o ! -e "${info_plist_path}" ]; then
-  echo "ERROR: BuildDetails.plist file does not exist at path: ${info_plist_path}" >&2
-  exit 1
-fi
-
-echo "Gathering build date..."
+  echo "BuildDetails.plist file does not exist at path: ${info_plist_path}" >&2
+else
+  echo "Gathering build date..."
 
 
-# Capture the current date and write it to BuildDetails.plist
-plutil -replace com-LoopFollow-build-date -string "$(date)" "${info_plist_path}"
+  # Capture the current date and write it to BuildDetails.plist
+  plutil -replace com-LoopFollow-build-date -string "$(date)" "${info_plist_path}"
+fi