🐛 Handle updated patch name

This commit is contained in:
Nikhil Badyal
2023-08-04 09:16:56 +05:30
parent 94cbfdae7f
commit 2e7d70b5db
3 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -55,7 +55,7 @@ jobs:
json_data=$(cat "${path}")
new_object='{
"patchName": "Change OAuth client id",
"patchName": "Spoof client",
"options": [
{
"key": "client-id",
@@ -63,8 +63,8 @@ jobs:
}
]
}'
# Check if an object with the patchName "Change OAuth client id" already exists
existing_object_index=$(echo "${json_data}" | jq 'map(.patchName) | index("Change OAuth client id")')
# Check if an object with the patchName "Spoof client" already exists
existing_object_index=$(echo "${json_data}" | jq 'map(.patchName) | index("Spoof client")')
echo "${existing_object_index}"
if [[ ${existing_object_index} != "null" ]]; then
echo "Patch entry already exists. Overriding client ID in it."
+1 -1
View File
@@ -1,6 +1,6 @@
[
{
"patchName": "Change OAuth client id",
"patchName": "Spoof client",
"options": [
{
"key": "client-id",
+3 -3
View File
@@ -6,7 +6,7 @@ path="apks/options.json"
json_data=$(cat "${path}")
new_object='{
"patchName": "Change OAuth client id",
"patchName": "Spoof client",
"options": [
{
"key": "client-id",
@@ -14,8 +14,8 @@ new_object='{
}
]
}'
# Check if an object with the patchName "Change OAuth client id" already exists
existing_object_index=$(echo "${json_data}" | jq 'map(.patchName) | index("Change OAuth client id")')
# Check if an object with the patchName "Spoof client" already exists
existing_object_index=$(echo "${json_data}" | jq 'map(.patchName) | index("Spoof client")')
echo "${existing_object_index}"
if [[ ${existing_object_index} != "null" ]]; then
echo "Exist"