Created
December 25, 2020 14:07
-
-
Save abelaska/310537c17a545943eac19554c6600c32 to your computer and use it in GitHub Desktop.
Cleanup Firebase real-time database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
remove() { | |
firebase --non-interactive -P fpm-prod database:remove -y "$1" | |
if [ "$?" != "0" ]; then | |
firebase --non-interactive -P fpm-prod database:get --shallow "$1" | jq 'keys[]' -r | while read l; do | |
remove "$1/$l" | |
done | |
fi | |
} | |
remove "/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment