Skip to content

Commit

Permalink
docs: remove extraneous escape (#8150)
Browse files Browse the repository at this point in the history
Old versions of bash (e.g. on macOS) don't handle ${P/:/\/} the same way as modern versions. In particular, the expanded parameter on macOS includes a backslash, causing subsequent use of the string as a filename to include a slash (/) instead of treating the slash as a directory separator. Both versions of bash accept ${P/://} as a way to substitute : with /. Verified that this change does not alter the generated docs when running under Linux.

Risk Level: low
Testing: generated docs under linux & macOS

Signed-off-by: Stephan Zuercher <zuercher@gmail.com>
  • Loading branch information
zuercher authored and htuch committed Sep 4, 2019
1 parent 1b3b4ae commit 2e6695b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ do
for p in $(bazel query "labels(srcs, ${PROTO_TARGET})" )
do
declare PROTO_TARGET_WITHOUT_PREFIX="${PROTO_TARGET#@envoy_api//}"
declare PROTO_TARGET_CANONICAL="${PROTO_TARGET_WITHOUT_PREFIX/:/\/}"
declare PROTO_TARGET_CANONICAL="${PROTO_TARGET_WITHOUT_PREFIX/://}"
declare PROTO_FILE_WITHOUT_PREFIX="${p#@envoy_api//}"
declare PROTO_FILE_CANONICAL="${PROTO_FILE_WITHOUT_PREFIX/:/\/}"
declare PROTO_FILE_CANONICAL="${PROTO_FILE_WITHOUT_PREFIX/://}"
declare DEST="${GENERATED_RST_DIR}/api-v2/${PROTO_FILE_CANONICAL#envoy/}".rst
mkdir -p "$(dirname "${DEST}")"
cp -f bazel-bin/external/envoy_api/"${PROTO_TARGET_CANONICAL}/${PROTO_FILE_CANONICAL}.rst" "$(dirname "${DEST}")"
Expand Down

0 comments on commit 2e6695b

Please sign in to comment.