- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitAddUpdateIgnore
More file actions
Latest commit
executable file
·38 lines (32 loc) · 1.31 KB
/
Copy pathgitAddUpdateIgnore
File metadata and controls
executable file
·38 lines (32 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
## -------------------------------------------------------------------
## gitRemoteUpdate Ignore List Updater 1.0.0
##
## This is free software: you are free to change and redistribute it.
## There is NO WARRANTY, to the extent permitted by law.
## -------------------------------------------------------------------
### Adds the current directory to the list of repos to ignore when running gitRemoteUpdate.
### Usage: gitAddUpdateIgnore [options]
###
### -h, --help Show help options.
### -v, --version Print program version.
help=$(grep "^### ""$0"| cut -c 5-)
version=$(grep "^## ""$0"| cut -c 4-)
eval"$(docopts -A args -h "$help" -V "$version":"$@")"
.$(dirname $0)/git-sh-prompt
.$(dirname $0)/scriptsConfig
REPODIR=$(echo $(cd "$(__gitdir)/.."; pwd)| tr / \\n | tail -1)
if [[ -n$REPODIR ]];then
if [[ !-e$GITDIR/.autoUpdateIgnore ]];then touch $GITDIR/.autoUpdateIgnore;fi
if [[ -z$(cat $GITDIR/.autoUpdateIgnore | egrep "\b$REPODIR\b") ]];then
echo$REPODIR>>$GITDIR/.autoUpdateIgnore
echo -e "\e[36mAdded $REPODIR to the git update ignore list.\e[m"
exit 0
else
echo -e "\e[31mERROR: This repository is already being ignored.\e[m"
exit 1
fi
else
echo -e "\e[31mERROR: Not within a git repository.\e[m"
exit 2
fi