File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ #! /usr/ bin/env bash
2
2
set -euo pipefail
3
3
4
+ is_tracked_by_git ()
5
+ {
6
+ git ls-files --error-unmatch " $1 " & > /dev/null
7
+ }
8
+
4
9
cd " $( dirname " $0 " ) /completions"
5
10
for f in * ; do
6
- case $f in
7
- Makefile* | README.md) ;;
8
- * ) git rm -f $f ;;
9
- esac
11
+ if [[ -h $f ]] && is_tracked_by_git " $f " ; then
12
+ git rm -f " $f "
13
+ fi
10
14
done
11
15
for f in ../../../completions/_* ; do
12
- ln -sf $f ${f##*/ _}
13
- git add --verbose ${f##*/ _}
16
+ if is_tracked_by_git " $f " ; then
17
+ ln -sf $f ${f##*/ _}
18
+ git add --verbose ${f##*/ _}
19
+ fi
14
20
done
Original file line number Diff line number Diff line change 1
- #! /bin/bash -u
1
+ #! /usr/bin/env bash
2
+ set -u
2
3
3
4
gitgrep ()
4
5
{
Original file line number Diff line number Diff line change 1
- #! /bin/bash -eu
1
+ #! /usr/bin/env bash
2
+ set -eu
2
3
3
4
mydir=$(
4
5
cd " $( dirname " $0 " ) "
You can’t perform that action at this time.
0 commit comments