From 2a291f3d224c103399f0eb20aa5a1ce90a184a42 Mon Sep 17 00:00:00 2001
From: Wooyoung Chung <yakle1218@gmail.com>
Date: Wed, 29 Dec 2021 15:51:53 +0900
Subject: [PATCH] Added automation script

---
 update.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 update.sh

diff --git a/update.sh b/update.sh
new file mode 100644
index 0000000..e04c510
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+CHECKSUM=''
+VERSION=''
+
+while getopts v:c: flag
+do
+    case "${flag}" in
+        v) VERSION=${OPTARG};;
+        c) CHECKSUM=${OPTARG};;
+        *) error "Unexpected option ${flag}";;
+    esac
+done
+
+if [ -z $CHECKSUM ]; then
+    echo "Checksum is required"
+fi
+
+if [ -z $VERSION ]; then
+    echo "Version is required"
+fi
+
+TEMPLATE="
+// swift-tools-version:5.3
+// The swift-tools-version declares the minimum version of Swift required to build this package.
+import PackageDescription
+let package = Package(
+    name: \"SendBirdSDK\",
+    platforms: [.iOS(.v10)],
+    products: [
+        .library(
+            name: \"SendBirdSDK\",
+            targets: [\"SendBirdSDK\"]
+        ),
+    ],
+    dependencies: [],
+    targets: [
+        .binaryTarget(
+            name: \"SendBirdSDK\",
+            url: \"https://github.com/sendbird/sendbird-ios-framework/releases/download/$VERSION/SendBirdSDK.xcframework.zip\",
+            checksum: \"$CHECKSUM\"
+        ),
+    ]
+)"
+
+echo -e "$TEMPLATE" > Package.swift