Skip to content

Commit 7cbef7b

Browse files
committed
Fix truncated logfile in verify-vendor
Writing to /dev/stderr causes a new FD to be opened. If this is a literal file, that file can get truncated. `>&2` does not suffer the same problem.
1 parent 04c2b1f commit 7cbef7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hack/update-vendor-licenses.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ fi
187187
# Loop through every vendored package
188188
for PACKAGE in $(go list -m -json all | jq -r .Path | sort -f); do
189189
if [[ -e "staging/src/${PACKAGE}" ]]; then
190-
echo "${PACKAGE} is a staging package, skipping" > /dev/stderr
190+
echo "${PACKAGE} is a staging package, skipping" >&2
191191
continue
192192
fi
193193
if [[ ! -e "${DEPS_DIR}/${PACKAGE}" ]]; then
194-
echo "${PACKAGE} doesn't exist in ${DEPS_DIR}, skipping" > /dev/stderr
194+
echo "${PACKAGE} doesn't exist in ${DEPS_DIR}, skipping" >&2
195195
continue
196196
fi
197197
echo "${PACKAGE}"
@@ -214,7 +214,7 @@ for PACKAGE in $(go list -m -json all | jq -r .Path | sort -f); do
214214
file="${CONTENT[${PACKAGE}-COPYING]-}"
215215
fi
216216
if [[ -z "${file}" ]]; then
217-
cat > /dev/stderr << __EOF__
217+
cat >&2 << __EOF__
218218
No license could be found for ${PACKAGE} - aborting.
219219
220220
Options:

0 commit comments

Comments
 (0)