Don't split declaration and assignment

This commit is contained in:
flyingscorpio@arch-desktop 2021-09-05 11:54:01 +02:00
parent 4200ea9613
commit 8a51cebd9a

View file

@ -87,10 +87,10 @@ system_update() {
aur_update() { aur_update() {
local start_dir="$PWD" local start_dir="$PWD"
local aur_packages; aur_packages=($(find ~/builds -name .git -type d -exec dirname {} \;)) local aur_packages=($(find ~/builds -name .git -type d -exec dirname {} \;))
for repo in "${aur_packages[@]}"; do for repo in "${aur_packages[@]}"; do
cd && cd "$repo" && git fetch -q cd && cd "$repo" && git fetch -q
local unpulled; unpulled=$(git log --pretty=format:'%h' '..@{u}' | wc -c) local unpulled=$(git log --pretty=format:'%h' '..@{u}' | wc -c)
if [ "$unpulled" -eq 0 ]; then if [ "$unpulled" -eq 0 ]; then
echo "$(basename "$repo") is up to date" echo "$(basename "$repo") is up to date"
else else
@ -109,7 +109,7 @@ aur_update() {
pull_from_repos() { pull_from_repos() {
local start_dir="$PWD" local start_dir="$PWD"
local git_repos; git_repos=($(find ~ -name .git -type d -not -path '*/.vim/*' -and -not -path '*/.local/*' -and -not -path '*/builds/*' -exec dirname {} \;)) 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 for repo in "${git_repos[@]}"; do
echo "Pulling from $repo..." echo "Pulling from $repo..."
cd "$repo" && git pull cd "$repo" && git pull