File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ COLOR_BLUE="\e[36m"
7
7
COLOR_WHITE=" \033[0;37m"
8
8
# COLOR_YELLOW="\033[0;33m"
9
9
# COLOR_OCHRE="\033[38;5;95m"
10
+ CHANGED_FILES_WARN=25
10
11
11
12
show_help () {
12
13
# echo -e '\n'
@@ -15,6 +16,7 @@ show_help() {
15
16
echo -e ' \t' " | (i)gnore - skip file |"
16
17
echo -e ' \t' " | (r)eset - unstage file |"
17
18
echo -e ' \t' " | checkout - checkout file (discard changes) |"
19
+ echo -e ' \t' " | rm - remove file |"
18
20
echo -e ' \t' " +----------------------------------------------------+"
19
21
}
20
22
@@ -32,6 +34,27 @@ read_command() {
32
34
done
33
35
}
34
36
37
+ CHANGED_FILES=$( git status -su | wc -l)
38
+ if [[ " $CHANGED_FILES " -ge " $CHANGED_FILES_WARN " ]];
39
+ then
40
+ echo " Too many changed files ($CHANGED_FILES ). Are you sure to continue? [y/n]" ;
41
+
42
+ while : ; do
43
+ read_command
44
+
45
+ if [ " $cmd " == " y" ];
46
+ then
47
+ break
48
+ fi
49
+
50
+ if [ " $cmd " == " n" ];
51
+ then
52
+ exit 100
53
+ fi
54
+ done
55
+ fi
56
+
57
+
35
58
git status -su | tr \\ r \\ n | while read -r line ;
36
59
do
37
60
FILE=$( echo " $line " | awk ' {$1 = ""; print substr($0,2)}' )
You can’t perform that action at this time.
0 commit comments