Skip to content

Instantly share code, notes, and snippets.

@Surendrajat
Created July 7, 2018 06:56
Embed
What would you like to do?
#!/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