Add function to check for unpushed repos
This commit is contained in:
parent
8a51cebd9a
commit
1cdc686fbe
1 changed files with 13 additions and 0 deletions
|
@ -117,6 +117,19 @@ pull_from_repos() {
|
||||||
cd "$start_dir" || exit 1
|
cd "$start_dir" || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_unpushed() {
|
||||||
|
local start_dir="$PWD"
|
||||||
|
local git_repos=($(find ~ -name .git -type d -not -path '*/.vim/*' -and -not -path '*/.local/*' -and -not -path '*/builds/*' -exec dirname {} \;))
|
||||||
|
for repo in "${git_repos[@]}"; do
|
||||||
|
cd "$repo" || exit 1
|
||||||
|
local unpushed=$(git log --pretty=format:'%h' '@{u}..' | wc -c)
|
||||||
|
if [ "$unpushed" -ne 0 ]; then
|
||||||
|
echo "Unpushed changes in $repo"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
cd "$start_dir" || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
hello() {
|
hello() {
|
||||||
if command -v protonvpn >/dev/null 2>&1; then
|
if command -v protonvpn >/dev/null 2>&1; then
|
||||||
sudo protonvpn c --cc NL
|
sudo protonvpn c --cc NL
|
||||||
|
|
Loading…
Add table
Reference in a new issue