Skip to content

Instantly share code, notes, and snippets.

@BenSYZ
Created February 23, 2022 01:32
Show Gist options
  • Save BenSYZ/c18179a4e97dde32c8f1a10df9a90b1e to your computer and use it in GitHub Desktop.
Save BenSYZ/c18179a4e97dde32c8f1a10df9a90b1e to your computer and use it in GitHub Desktop.
#!/bin/sh
while read line;do
echo $line
cd $line
repo_name=$(git remote -v |grep -E '.*https://aur.tuna.tsinghua.edu.cn/.*' |awk '{print $2}' |head -n1 |awk -v FS='/' '{print $4}')
if [[ "$repo_name" != "" ]];then
git remote set-url origin https://aur.archlinux.org/$repo_name
#git remote -v |head -n1
#echo https://aur.archlinux.org/$repo_name
#echo ======
fi
cd ..
done <<<$(find . -maxdepth 1 -type d|grep -v '^.$')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment