Skip to content

Instantly share code, notes, and snippets.

@Surendrajat
Created July 7, 2018 06:56
Show Gist options
  • Save Surendrajat/992c5fb4bddc4f9f1381572b62177d76 to your computer and use it in GitHub Desktop.
Save Surendrajat/992c5fb4bddc4f9f1381572b62177d76 to your computer and use it in GitHub Desktop.
#!/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