clean-check-prepare 261 B

12345678910111213
  1. #!/bin/bash
  2. set -eu -o pipefail
  3. top_dir="$(readlink -m "${BASH_SOURCE[0]}/../..")"
  4. clean_dir="$top_dir.clean-check.clean"
  5. if [ -n "${JENKINS_HOME:-}" ]; then
  6. clean_dir="/tmp/$(basename "$clean_dir")"
  7. fi
  8. rm -rf "$clean_dir"
  9. cp -a "$top_dir" "$clean_dir"