Merge pull request #236 from nikhilbadyal/234-sync-for-reddit-oauth-id-not-found

🐛 Handle updated patch name
This commit is contained in:
Nikhil Badyal
2023-08-04 10:16:40 +05:30
committed by GitHub
3 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -55,7 +55,7 @@ jobs:
json_data=$(cat "${path}") json_data=$(cat "${path}")
new_object='{ new_object='{
"patchName": "Change OAuth client id", "patchName": "Spoof client",
"options": [ "options": [
{ {
"key": "client-id", "key": "client-id",
@@ -63,8 +63,8 @@ jobs:
} }
] ]
}' }'
# Check if an object with the patchName "Change OAuth client id" already exists # Check if an object with the patchName "Spoof client" already exists
existing_object_index=$(echo "${json_data}" | jq 'map(.patchName) | index("Change OAuth client id")') existing_object_index=$(echo "${json_data}" | jq 'map(.patchName) | index("Spoof client")')
echo "${existing_object_index}" echo "${existing_object_index}"
if [[ ${existing_object_index} != "null" ]]; then if [[ ${existing_object_index} != "null" ]]; then
echo "Patch entry already exists. Overriding client ID in it." 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": [ "options": [
{ {
"key": "client-id", "key": "client-id",
+3 -3
View File
@@ -6,7 +6,7 @@ path="apks/options.json"
json_data=$(cat "${path}") json_data=$(cat "${path}")
new_object='{ new_object='{
"patchName": "Change OAuth client id", "patchName": "Spoof client",
"options": [ "options": [
{ {
"key": "client-id", "key": "client-id",
@@ -14,8 +14,8 @@ new_object='{
} }
] ]
}' }'
# Check if an object with the patchName "Change OAuth client id" already exists # Check if an object with the patchName "Spoof client" already exists
existing_object_index=$(echo "${json_data}" | jq 'map(.patchName) | index("Change OAuth client id")') existing_object_index=$(echo "${json_data}" | jq 'map(.patchName) | index("Spoof client")')
echo "${existing_object_index}" echo "${existing_object_index}"
if [[ ${existing_object_index} != "null" ]]; then if [[ ${existing_object_index} != "null" ]]; then
echo "Exist" echo "Exist"