update script to use relative path

This commit is contained in:
Abhinav 2023-04-01 10:06:49 +05:30
parent 332ff3b299
commit ab7460d8db

View file

@ -8,17 +8,17 @@ then
fi
# Get the keys from the JSON file
keys=$(jq -r 'keys[]' /Users/abhi/ente/bada-frame/public/locales/en/translation.json)
keys=$(jq -r 'keys[]' ./public/locales/en/translation.json)
# Loop through the keys
for key in $keys
do
# Check if the key is present in any of the files in the folder
grep -rqE "'$key'|\"$key\"" /Users/abhi/ente/bada-frame/src
grep -rqE "'$key'|\"$key\"" ./src
if [ $? -ne 0 ]
then
echo "$key is not present as a string in any of the files in the folder"
# Remove the key from the JSON file
jq "del(.\"$key\")" /Users/abhi/ente/bada-frame/public/locales/en/translation.json > /tmp/temp.json && mv /tmp/temp.json /Users/abhi/ente/bada-frame/public/locales/en/translation.json
jq "del(.\"$key\")" ./public/locales/en/translation.json > /tmp/temp.json && mv /tmp/temp.json ./public/locales/en/translation.json
fi
done