Skip to content

Commit

Permalink
Add clean_legacy_e2e.sh script for local dev (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan authored and alexeagle committed May 22, 2019
1 parent d024566 commit 9918842
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scripts/clean_legacy_e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

set -eu -o pipefail
# -e: exits if a command fails
# -u: errors if an variable is referenced before being set
# -o pipefail: causes a pipeline to produce a failure return code if any command errors

readonly E2E_TESTS=${@:?"No e2e test names specified"}

readonly RULES_NODEJS_DIR=$(cd $(dirname "$0")/..; pwd)
readonly E2E_DIR="${RULES_NODEJS_DIR}/internal/e2e"

echo_and_run() { echo "+ $@" ; "$@" ; }

for e2eTest in ${E2E_TESTS[@]} ; do
(
# Clean e2e test
cd "${E2E_DIR}/${e2eTest}"
printf "\n\nCleaning legacy e2e test ${e2eTest}\n"
${RULES_NODEJS_DIR}/scripts/unlink_deps.sh
echo_and_run bazel clean --expunge
echo_and_run rm -rf `find . -type d -name node_modules -prune`
)
done

0 comments on commit 9918842

Please sign in to comment.