build-release-tarball: Fix shellcheck warnings.

In tools/build-release-tarball line 50:
for i in `cat "$TMPDIR/$prefix/tools/release-tarball-exclude.txt"`; do
         ^-- SC2013: To read lines rather than words, pipe/redirect to a 'while read' loop.
         ^-- SC2006: Use $(..) instead of legacy `..`.

In tools/build-release-tarball line 51:
    rm -r --interactive=never "$TMPDIR/$prefix/$i";
                              ^-- SC2115: Use "${var:?}" to ensure this never expands to / .

In tools/build-release-tarball line 97:
    echo; echo -ne "\033[33mRunning update-prod-static failed. "
                    ^-- SC1117: Backslash is literal in "\0". Prefer explicit escaping: "\\0".

In tools/build-release-tarball line 98:
    echo -e "Check $TMPDIR/update-prod-static.log for more information.\033[0m"
                                                                       ^-- SC1117: Backslash is literal in "\0". Prefer explicit escaping: "\\0".

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2018-08-03 00:14:48 +00:00 committed by Tim Abbott
parent a5280d7d02
commit b5bfe77844
1 changed files with 5 additions and 5 deletions

View File

@ -47,9 +47,9 @@ git archive -o "$TARBALL" "--prefix=$prefix/" HEAD
cd "$TMPDIR" cd "$TMPDIR"
tar -xf "$TARBALL" tar -xf "$TARBALL"
for i in `cat "$TMPDIR/$prefix/tools/release-tarball-exclude.txt"`; do while read -r i; do
rm -r --interactive=never "$TMPDIR/$prefix/$i"; rm -r --interactive=never "${TMPDIR:?}/$prefix/$i";
done done < "$TMPDIR/$prefix/tools/release-tarball-exclude.txt"
tar -cf "$TARBALL" "$prefix" tar -cf "$TARBALL" "$prefix"
rm -rf "$prefix" rm -rf "$prefix"
@ -94,8 +94,8 @@ ln -nfs "$BUILD_PROD_STATIC_LOGPATH" "$USER_PROD_STATIC_LOGPATH"
./tools/update-prod-static $authors_not_required || ( ./tools/update-prod-static $authors_not_required || (
set +x set +x
echo; echo -ne "\033[33mRunning update-prod-static failed. " echo; echo -ne '\033[33mRunning update-prod-static failed. '
echo -e "Check $TMPDIR/update-prod-static.log for more information.\033[0m" echo -e "Check $TMPDIR/update-prod-static.log for more information.\\033[0m"
exit 1 exit 1
) )
rm -f "$USER_PROD_STATIC_LOGPATH" rm -f "$USER_PROD_STATIC_LOGPATH"