Skip to content

Commit 442131f

Browse files
committed
only ask for the version number once in update_swift_package.sh
1 parent b7ce556 commit 442131f

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

iOS_SDK/OneSignalSDK/update_swift_package.sh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ SWIFT_PACKAGE_DIRECTORY="${WORKING_DIR}/../.."
2222

2323
SWIFT_PACKAGE_PATH="${SWIFT_PACKAGE_DIRECTORY}/Package.swift"
2424

25+
#Ask for the new release version number to be placed in the package URL
26+
echo -e "\033[1mEnter the new SDK release version number\033[0m"
27+
read VERSION_NUMBER
28+
2529
# Remove the old Zipped XCFramework and create a new Zip
2630
echo "Removing old Zipped XCFramework ${FRAMEWORK_ZIP_PATH}"
2731
rm -rf "${FRAMEWORK_ZIP_PATH}"
@@ -35,9 +39,6 @@ SWIFT_PM_CHECKSUM_LINE=" checksum: \"${CHECKSUM}\""
3539

3640
# Use sed to remove line 62 from the Swift.package and replace it with the new checksum
3741
sed -i '' "62s/.*/$SWIFT_PM_CHECKSUM_LINE/" "${SWIFT_PACKAGE_PATH}"
38-
#Ask for the new release version number to be placed in the package URL
39-
echo -e "\033[1mEnter the new SDK release version number\033[0m"
40-
read VERSION_NUMBER
4142
SWIFT_PM_URL_LINE=" url: \"https:\/\/github.com\/OneSignal\/OneSignal-iOS-SDK\/releases\/download\/${VERSION_NUMBER}\/OneSignalCore.xcframework.zip\","
4243
#Use sed to remove line 61 from the Swift.package and replace it with the new URL for the new release
4344
sed -i '' "61s/.*/$SWIFT_PM_URL_LINE/" "${SWIFT_PACKAGE_PATH}"
@@ -77,9 +78,6 @@ SWIFT_PM_CHECKSUM_LINE=" checksum: \"${CHECKSUM}\""
7778
echo ${CHECKSUM}
7879
# Use sed to remove line 57 from the Swift.package and replace it with the new checksum
7980
sed -i '' "57s/.*/$SWIFT_PM_CHECKSUM_LINE/" "${SWIFT_PACKAGE_PATH}"
80-
#Ask for the new release version number to be placed in the package URL
81-
echo -e "\033[1mEnter the new SDK release version number\033[0m"
82-
read VERSION_NUMBER
8381
SWIFT_PM_URL_LINE=" url: \"https:\/\/github.com\/OneSignal\/OneSignal-iOS-SDK\/releases\/download\/${VERSION_NUMBER}\/OneSignalOutcomes.xcframework.zip\","
8482
#Use sed to remove line 56 from the Swift.package and replace it with the new URL for the new release
8583
sed -i '' "56s/.*/$SWIFT_PM_URL_LINE/" "${SWIFT_PACKAGE_PATH}"
@@ -119,9 +117,6 @@ SWIFT_PM_CHECKSUM_LINE=" checksum: \"${CHECKSUM}\""
119117
echo ${CHECKSUM}
120118
# Use sed to remove line 52 from the Swift.package and replace it with the new checksum
121119
sed -i '' "52s/.*/$SWIFT_PM_CHECKSUM_LINE/" "${SWIFT_PACKAGE_PATH}"
122-
#Ask for the new release version number to be placed in the package URL
123-
echo -e "\033[1mEnter the new SDK release version number\033[0m"
124-
read VERSION_NUMBER
125120
SWIFT_PM_URL_LINE=" url: \"https:\/\/github.com\/OneSignal\/OneSignal-iOS-SDK\/releases\/download\/${VERSION_NUMBER}\/OneSignalExtension.xcframework.zip\","
126121
#Use sed to remove line 51 from the Swift.package and replace it with the new URL for the new release
127122
sed -i '' "51s/.*/$SWIFT_PM_URL_LINE/" "${SWIFT_PACKAGE_PATH}"
@@ -161,9 +156,6 @@ SWIFT_PM_CHECKSUM_LINE=" checksum: \"${CHECKSUM}\""
161156
echo ${CHECKSUM}
162157
# Use sed to remove line 47 from the Swift.package and replace it with the new checksum
163158
sed -i '' "47s/.*/$SWIFT_PM_CHECKSUM_LINE/" "${SWIFT_PACKAGE_PATH}"
164-
#Ask for the new release version number to be placed in the package URL
165-
echo -e "\033[1mEnter the new SDK release version number\033[0m"
166-
read VERSION_NUMBER
167159
SWIFT_PM_URL_LINE=" url: \"https:\/\/github.com\/OneSignal\/OneSignal-iOS-SDK\/releases\/download\/${VERSION_NUMBER}\/OneSignal.xcframework.zip\","
168160
#Use sed to remove line 46 from the Swift.package and replace it with the new URL for the new release
169161
sed -i '' "46s/.*/$SWIFT_PM_URL_LINE/" "${SWIFT_PACKAGE_PATH}"

0 commit comments

Comments
 (0)