Changeset View
Changeset View
Standalone View
Standalone View
swh/web/client/tests/gen-api-data.sh
Show All 12 Lines | |||||
urls="" | urls="" | ||||
urls="${urls} content/sha1_git:fe95a46679d128ff167b7c55df5d02356c5a1ae1/" | urls="${urls} content/sha1_git:fe95a46679d128ff167b7c55df5d02356c5a1ae1/" | ||||
urls="${urls} directory/977fc4b98c0e85816348cebd3b12026407c368b6/" | urls="${urls} directory/977fc4b98c0e85816348cebd3b12026407c368b6/" | ||||
urls="${urls} release/b9db10d00835e9a43e2eebef2db1d04d4ae82342/" | urls="${urls} release/b9db10d00835e9a43e2eebef2db1d04d4ae82342/" | ||||
urls="${urls} revision/aafb16d69fd30ff58afdd69036a26047f3aebdc6/" | urls="${urls} revision/aafb16d69fd30ff58afdd69036a26047f3aebdc6/" | ||||
urls="${urls} snapshot/6a3a2cf0b2b90ce7ae1cf0a221ed68035b686f5a/" | urls="${urls} snapshot/6a3a2cf0b2b90ce7ae1cf0a221ed68035b686f5a/" | ||||
urls="${urls} snapshot/cabcc7d7bf639bbe1cc3b41989e1806618dd5764/" | urls="${urls} snapshot/cabcc7d7bf639bbe1cc3b41989e1806618dd5764/" | ||||
urls="${urls} snapshot/cabcc7d7bf639bbe1cc3b41989e1806618dd5764/?branches_count=1000&branches_from=refs/tags/v3.0-rc7" | urls="${urls} snapshot/cabcc7d7bf639bbe1cc3b41989e1806618dd5764/?branches_count=1000&branches_from=refs/tags/v3.0-rc7" | ||||
urls="${urls} origin/https://github.com/NixOS/nixpkgs/visits?last_visit=50&per_page=10" | |||||
urls="${urls} origin/https://github.com/NixOS/nixpkgs/visits/?last_visit=40&per_page=10" | |||||
echo "# GENERATED FILE, DO NOT EDIT." | echo "# GENERATED FILE, DO NOT EDIT." | ||||
echo "# Run './gen-api-data.sh > api_data.py' instead." | echo "# Run './gen-api-data.sh > api_data.py' instead." | ||||
echo | echo | ||||
echo "API_URL = \"${API_URL_test}\"" | echo "API_URL = \"${API_URL_test}\"" | ||||
echo | echo | ||||
echo 'API_DATA = {' | echo 'API_DATA = {' | ||||
for url in ${urls} ; do | for url in ${urls} ; do | ||||
echo " \"${url}\": # NoQA: E501" | echo " \"${url}\": # NoQA: E501" | ||||
echo ' r"""' | echo ' r"""' | ||||
curl --silent "${API_URL_real}/${url}" | jq --monochrome-output . | curl --location --silent "${API_URL_real}/${url}" | jq --monochrome-output . | ||||
olasd: If you add the trailing slash you shouldn't need to follow redirects. | |||||
echo ' """, # NoQA: E501' | echo ' """, # NoQA: E501' | ||||
done | done | ||||
echo '}' | echo '}' |
If you add the trailing slash you shouldn't need to follow redirects.