gCubeActions/generateRepoList.sh

9 lines
531 B
Bash
Executable File

#!/usr/bin/env bash
timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
curl -X GET "https://code-repo.d4science.org/api/v1/orgs/gCubeSystem/repos" -H "accept: application/json" | python -mjson.tool > allp.json
grep "\"name\": " allp.json > all_filtered.json
sed "s/^[ \t]*\"name\": \"//g" all_filtered.json > all_filtered1.txt
sed 's/\",//g' all_filtered1.txt > all_filtered2.txt
sort all_filtered2.txt > all_sorted.txt
mv all_sorted.txt gCubeSystem_all_sorted_$timestamp.txt
rm allp.json all_filtered.json all_filtered1.txt all_filtered2.txt