Created
July 7, 2018 06:56
-
-
Save Surendrajat/992c5fb4bddc4f9f1381572b62177d76 to your computer and use it in GitHub Desktop.
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 | |
user= | |
pass= | |
###### file containing github links for all device trees | |
file=clone_device.url | |
while IFS= read -r line; do | |
newName=$(echo $line | cut -d / -f5 | cut -d . -f1 | sed 's/android_device_/android_device_samsung_/g') | |
printf -v new '{"name": "%s" }' "$newName" | |
oldName="$(echo $line | cut -d / -f5 | cut -d . -f1)" | |
echo $newName $oldName | |
curl -u "$user:$pass" -X PATCH -d "$new" https://api.github.com/repos/TwrpBuilder/$oldName | |
done < "$file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment