clean-check-test-copy 366 B

1234567891011121314151617
  1. #!/bin/bash
  2. set -eu -o pipefail
  3. # Creates a test copy where you can check `make clean` without messing with
  4. # your main dir.
  5. top_dir="$(readlink -m "${BASH_SOURCE[0]}/../..")"
  6. test_dir="$top_dir.clean-check.test"
  7. if [ -n "${JENKINS_HOME:-}" ]; then
  8. test_dir="/tmp/$(basename "$test_dir")"
  9. fi
  10. rm -rf "$test_dir"
  11. cp -a "$top_dir" "$test_dir"
  12. echo "$test_dir"