File tree 3 files changed +10
-8
lines changed
3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ not() {
11
11
! " $@ "
12
12
}
13
13
14
+ # noret_grep will return 0 if zero or more lines were selected, and >1 if an
15
+ # error occurred. Suppresses grep's return code of 1 when there are no matches
16
+ # (for eg, empty file).
17
+ noret_grep () {
18
+ grep " $@ " || [[ $? == 1 ]]
19
+ }
20
+
14
21
die () {
15
22
echo " $@ " >&2
16
23
exit 1
Original file line number Diff line number Diff line change 3
3
set -e # Exit on error
4
4
set -o pipefail # Fail a pipe if any sub-command fails.
5
5
6
+ source " $( dirname $0 ) /common.sh"
7
+
6
8
if [[ " $# " -ne 1 || ! -d " $1 " ]]; then
7
9
echo " Specify a valid output directory as the first parameter."
8
10
exit 1
@@ -16,6 +18,6 @@ cd "${SCRIPTS_DIR}/.."
16
18
git ls-files -- ' *.go' | grep -v ' \(^\|/\)\(internal\|examples\|benchmark\|interop\|test\|testdata\)\(/\|$\)' | xargs dirname | sort -u | while read d; do
17
19
pushd " $d " > /dev/null
18
20
pkg=" $( echo " $d " | sed ' s;\.;grpc;' | sed ' s;/;_;g' ) "
19
- go list -deps . | sort > | " ${OUTPUT_DIR} /$pkg "
21
+ go list -deps . | sort | noret_grep -v ' google.golang.org/grpc ' > | " ${OUTPUT_DIR} /$pkg "
20
22
popd > /dev/null
21
23
done
Original file line number Diff line number Diff line change @@ -8,13 +8,6 @@ source "$(dirname $0)/common.sh"
8
8
# Check to make sure it's safe to modify the user's git repo.
9
9
git status --porcelain | fail_on_output
10
10
11
- # noret_grep will return 0 if zero or more lines were selected, and >1 if an
12
- # error occurred. Suppresses grep's return code of 1 when there are no matches
13
- # (for eg, empty file).
14
- noret_grep () {
15
- grep " $@ " || [[ $? == 1 ]]
16
- }
17
-
18
11
# Undo any edits made by this script.
19
12
cleanup () {
20
13
git reset --hard HEAD
You can’t perform that action at this time.
0 commit comments