bash: fix git-script linter errors
Signed-off-by: Michael Grote <michael.grote@posteo.de>
This commit is contained in:
parent
5927a331a0
commit
91aebe2017
2 changed files with 6 additions and 3 deletions
|
@ -1,2 +1,3 @@
|
|||
#!/bin/bash
|
||||
# shellcheck disable=SC2063
|
||||
git branch | grep -v "*" | grep -v master | grep -v main | xargs git branch -D ; git fetch --prune
|
||||
|
|
|
@ -13,13 +13,14 @@ function update {
|
|||
if [ -e "$d/.ignore" ]; then
|
||||
echo -e "\n${HIGHLIGHT}Ignoring $d${NORMAL}"
|
||||
else
|
||||
cd $d > /dev/null
|
||||
cd "$d" || exit > /dev/null
|
||||
if [ -d ".git" ]; then
|
||||
echo -e "\n${HIGHLIGHT}Updating pwd$NORMAL"
|
||||
git add .
|
||||
git stash
|
||||
git pull
|
||||
else
|
||||
# shellcheck disable=SC2035
|
||||
scan *
|
||||
fi
|
||||
cd .. > /dev/null
|
||||
|
@ -30,12 +31,13 @@ function update {
|
|||
|
||||
function scan {
|
||||
#echo "pwd"
|
||||
for x in $*; do
|
||||
for x in "$@"; do
|
||||
update "$x"
|
||||
done
|
||||
}
|
||||
|
||||
if [ "$1" != "" ]; then cd $1 > /dev/null; fi
|
||||
if [ "$1" != "" ]; then cd "$1" || exit > /dev/null; fi
|
||||
|
||||
echo -e "${HIGHLIGHT}Scanning ${PWD}${NORMAL}"
|
||||
# shellcheck disable=SC2035
|
||||
scan *
|
||||
|
|
Loading…
Reference in a new issue