Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #104 from Shufflepuck/hotfix/fix-build-errors
Browse files Browse the repository at this point in the history
Fix build errors
  • Loading branch information
damien-rivet committed Oct 30, 2018
2 parents 3bc3415 + 7f8b9b8 commit 988f152
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions SplashBuddy/Business Objects/Software/SoftwareArray.swift
Expand Up @@ -44,17 +44,17 @@ class SoftwareArray: NSObject {

/// Returns a localized error or nil if no error
var localizedErrorStatus: String? {
let _failedSoftwareArray = SoftwareArray.sharedInstance.failedSoftwareArray()
let failedSoftwareArray = SoftwareArray.sharedInstance.failedSoftwareArray()

if _failedSoftwareArray.count == 1 {
if failedSoftwareArray.count == 1 {

if let failedDisplayName = _failedSoftwareArray[0].displayName {
if let failedDisplayName = failedSoftwareArray[0].displayName {
return String.localizedStringWithFormat(NSLocalizedString("error.failed_specific_app_install"), failedDisplayName)

} else {
return NSLocalizedString("error.failed_unknown_app_install")
}
} else if _failedSoftwareArray.count > 1 {
} else if failedSoftwareArray.count > 1 {
return NSLocalizedString("error.failed_multiple_app_install")

} else {
Expand Down
32 changes: 16 additions & 16 deletions SplashBuddy/Tools/Regexes.swift
Expand Up @@ -12,47 +12,47 @@ import Foundation

func initRegex() -> [Software.SoftwareStatus: NSRegularExpression?] {

let re_options = NSRegularExpression.Options.anchorsMatchLines
let reOptions = NSRegularExpression.Options.anchorsMatchLines

// Installing
let re_installing: NSRegularExpression?
let reInstalling: NSRegularExpression?

do {
try re_installing = NSRegularExpression(
try reInstalling = NSRegularExpression(
pattern: "(?<=Installing )([a-zA-Z0-9._ ]*)-([a-zA-Z0-9._]*).pkg...$",
options: re_options
options: reOptions
)
} catch {
re_installing = nil
reInstalling = nil
}

// Failure
let re_failure: NSRegularExpression?
let reFailure: NSRegularExpression?

do {
try re_failure = NSRegularExpression(
try reFailure = NSRegularExpression(
pattern: "(?<=Installation failed. The installer reported: installer: Package name is )([a-zA-Z0-9._ ]*)-([a-zA-Z0-9._]*)$",
options: re_options
options: reOptions
)
} catch {
re_failure = nil
reFailure = nil
}

// Success
let re_success: NSRegularExpression?
let reSuccess: NSRegularExpression?

do {
try re_success = NSRegularExpression(
try reSuccess = NSRegularExpression(
pattern: "(?<=Successfully installed )([a-zA-Z0-9._ ]*)-([a-zA-Z0-9._]*).pkg",
options: re_options
options: reOptions
)
} catch {
re_success = nil
reSuccess = nil
}

return [
.success: re_success,
.failed: re_failure,
.installing: re_installing
.success: reSuccess,
.failed: reFailure,
.installing: reInstalling
]
}

0 comments on commit 988f152

Please sign in to comment.