Created
February 14, 2020 14:35
-
-
Save joeydebreuk/6319e598cfacd081f9290ffe2dc643f1 to your computer and use it in GitHub Desktop.
Download export from Translationhut
This file contains hidden or 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 | |
SECRET=YOURSECRET | |
WRITE_TO_DIR=src/messages | |
URL="https://translationhut.com/export/flat_json?languages=EN-US,NL-NL&include_empty=false" | |
# Download file to messages.zip | |
curl "$URL" -H "Authorization: Api-Key $SECRET" --output messages.zip | |
# unzip messages.zip to relative path folder, declared in "WRITE_TO_DIR" | |
# -o flag will make unzip overwrite destination files | |
unzip -o messages -d $WRITE_TO_DIR; | |
if [[ $? != 0 ]]; | |
then | |
# If something went wrong, log the downloaded files, | |
# since it will most likely contain errors | |
printf '\n\nSomething went wrong.\n' | |
cat messages.zip; | |
fi; | |
rm messages.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment