Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 0e64aef

Browse files
authored
Fix Initializer for conditional binding must have Optional type, not 'NSError'
1 parent 80c46dc commit 0e64aef

3 files changed

Lines changed: 17 additions & 20 deletions

File tree

.github/workflows/build-ipa.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,19 @@ jobs:
9797
set -e
9898
ARCHIVE_PATH="$PWD/build/prostore.xcarchive"
9999
mkdir -p build
100-
101-
# Try to read cached objectVersion from file
100+
101+
# Cache file
102102
CACHE_FILE=".object_version_cache"
103103
CACHED_VERSION=""
104-
candidates=(77)
105-
104+
candidates=(77) # Add other candidate versions if needed
105+
106+
# Try cached version first
106107
if [ -f "$CACHE_FILE" ]; then
107108
CACHED_VERSION=$(cat "$CACHE_FILE" | tr -d '\n')
108109
echo "Found cached objectVersion: $CACHED_VERSION"
109-
110-
# Test the cached version first
111110
echo "----- Testing cached objectVersion = $CACHED_VERSION -----"
112111
/usr/bin/perl -0777 -pe "s/objectVersion = \\d+;/objectVersion = $CACHED_VERSION;/" -i.bak prostore.xcodeproj/project.pbxproj || true
113-
112+
114113
set +e
115114
xcodebuild clean archive \
116115
-project prostore.xcodeproj \
@@ -121,25 +120,24 @@ jobs:
121120
CODE_SIGN_IDENTITY="" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO
122121
rc=$?
123122
set -e
124-
123+
125124
if [ $rc -eq 0 ]; then
126125
echo "✅ Cached objectVersion $CACHED_VERSION works!"
127126
echo "object_version=$CACHED_VERSION" >> $GITHUB_OUTPUT
128-
echo "$CACHED_VERSION" > "$CACHE_FILE"
129127
exit 0
130128
else
131-
echo "❌ Cached objectVersion $CACHED_VERSION failed, trying other candidates..."
129+
echo "❌ Cached objectVersion $CACHED_VERSION failed, trying candidates..."
132130
fi
133131
fi
134-
135-
# If no cache or cached version failed, try all candidates
132+
133+
# Try all candidates
136134
build_ok=0
137135
for v in "${candidates[@]}"; do
138136
echo "----- Attempting build with objectVersion = $v -----"
139137
/usr/bin/perl -0777 -pe "s/objectVersion = \\d+;/objectVersion = $v;/" -i.bak prostore.xcodeproj/project.pbxproj || true
140-
echo "Applied objectVersion $v. Header preview:"
138+
echo "Header preview:"
141139
sed -n '1,20p' prostore.xcodeproj/project.pbxproj || true
142-
echo "Running xcodebuild archive..."
140+
143141
set +e
144142
xcodebuild clean archive \
145143
-project prostore.xcodeproj \
@@ -154,16 +152,15 @@ jobs:
154152
echo "✅ xcodebuild succeeded with objectVersion = $v"
155153
echo "object_version=$v" >> $GITHUB_OUTPUT
156154
echo "$v" > "$CACHE_FILE"
157-
echo "Cached successful objectVersion: $v"
158155
build_ok=1
159156
break
160157
else
161158
echo "❌ xcodebuild failed (exit $rc). Trying next objectVersion..."
162159
fi
163160
done
164-
161+
165162
if [ "$build_ok" -ne 1 ]; then
166-
echo "ERROR: All objectVersion attempts failed. Dumping debug info:"
163+
echo "ERROR: All objectVersion attempts failed."
167164
echo "===== project.pbxproj header ====="
168165
sed -n '1,200p' prostore.xcodeproj/project.pbxproj || true
169166
echo "===== build directory listing ====="

Sources/prostore/signing/DownloadSignManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,12 @@ class DownloadSignManager: ObservableObject {
334334
} catch {
335335
await MainActor.run {
336336
let errorMessage: String
337-
if let nsError = error as NSError {
337+
if let nsError = error as? NSError {
338338
errorMessage = nsError.localizedDescription
339339
} else {
340340
errorMessage = "❌ Install failed: \(error.localizedDescription)"
341341
}
342-
342+
343343
self.showError(message: errorMessage)
344344
self.installationStream = nil
345345
self.installationTask = nil

Sources/prostore/views/AppsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public struct AppVersion: Decodable {
9595
let localizedDescription: String?
9696
}
9797
// Final AltApp used by the UI (includes repositoryName)
98-
public struct AltApp: Identifiable, Equatable {
98+
public struct AltApp: Identifiable, Equatable, Sendable {
9999
public var id: String { bundleIdentifier }
100100
public let name: String
101101
public let bundleIdentifier: String

0 commit comments

Comments
 (0)