Skip to content

Instantly share code, notes, and snippets.

@holishing
Created July 28, 2021 16:03
Show Gist options
  • Save holishing/c145f196962d775ffee92619295203b0 to your computer and use it in GitHub Desktop.
Save holishing/c145f196962d775ffee92619295203b0 to your computer and use it in GitHub Desktop.
update git repo desc for bash
#!/usr/bin/env bash
set -x
for i in $(ls -d git/*.git)
do
cd "$i"
git fetch
git_remote_url=$(git config --get remote.origin.url)
if [[ $git_remote_url == *"github.com"* ]]; then
wget -O - https://api.github.com/repos/$(git config --get remote.origin.url|sed -e "s/^https:\/\/github.com\///" -e "s/\.git$//") | jq -r .description | tee description
fi
cd ${HOME}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment