playwright-screenshots: clean up output and error handling
Somebody wrote those `pushd` and `popd` lines without testing them. Redirections bind tighter than `||` so those lines were always spamming the console. Using `set -e` is more reliable than always checking exit codes anyway.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
# Handle symlinks here as we tend to be executed as an npm binary
|
# Handle symlinks here as we tend to be executed as an npm binary
|
||||||
SCRIPT_PATH=$(readlink -f "$0")
|
SCRIPT_PATH=$(readlink -f "$0")
|
||||||
SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
|
SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
|
||||||
@@ -83,11 +85,11 @@ done
|
|||||||
build_image
|
build_image
|
||||||
|
|
||||||
# Ensure we pass all symlinked node_modules to the container
|
# Ensure we pass all symlinked node_modules to the container
|
||||||
pushd node_modules || exit > /dev/null
|
pushd node_modules > /dev/null
|
||||||
SYMLINKS=$(find . -maxdepth 2 -type l -not -path "./.bin/*")
|
SYMLINKS=$(find . -maxdepth 2 -type l -not -path "./.bin/*")
|
||||||
popd || exit > /dev/null
|
popd > /dev/null
|
||||||
for LINK in $SYMLINKS; do
|
for LINK in $SYMLINKS; do
|
||||||
TARGET=$(readlink -f "node_modules/$LINK")
|
TARGET=$(readlink -f "node_modules/$LINK") || true
|
||||||
if [ -d "$TARGET" ]; then
|
if [ -d "$TARGET" ]; then
|
||||||
echo "mounting linked package ${LINK:2} in container"
|
echo "mounting linked package ${LINK:2} in container"
|
||||||
RUN_ARGS+=( "-v" "$TARGET:/work/node_modules/${LINK:2}" )
|
RUN_ARGS+=( "-v" "$TARGET:/work/node_modules/${LINK:2}" )
|
||||||
|
|||||||
Reference in New Issue
Block a user