Skip to content

Commit 259e74e

Browse files
committed
Analyze all folders in folder - git status
1 parent 1bdf2b2 commit 259e74e

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

git/analyze_changes_in_folders.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
COLOR_RED="\033[0;31m"
4+
COLOR_GREEN="\033[0;32m"
5+
COLOR_BLUE="\e[36m"
6+
COLOR_WHITE="\033[0;37m"
7+
8+
clear
9+
10+
read_command() {
11+
while read -p "$: " cmd </dev/tty
12+
do
13+
if [ "$cmd" != "q" ] && [ "$cmd" != "" ];
14+
then
15+
break
16+
fi
17+
done
18+
}
19+
20+
echo 'This script loops all folders in current directory "'$(pwd)'" and show git changes.'
21+
echo 'Do you want to continue?'
22+
while :; do
23+
read_command
24+
25+
if [ "$cmd" == "y" ];
26+
then
27+
break
28+
fi
29+
30+
if [ "$cmd" == "n" ];
31+
then
32+
exit 100
33+
fi
34+
done
35+
36+
37+
ls -d */ | while read -r line;
38+
do
39+
echo -e "$COLOR_BLUE"
40+
echo 'Showing git status of folder:' $line
41+
echo -e "$COLOR_WHITE"
42+
43+
exec 3>&1
44+
exec 1> >(paste /dev/null -)
45+
46+
git -C $line status
47+
48+
exec 1>&3 3>&-
49+
done;

0 commit comments

Comments
 (0)