My configuration files for Debian/Ubuntu applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tpm.sh 372 B

12345678910111213
  1. check_dir_exists_helper() {
  2. [ -d "$1" ]
  3. }
  4. # runs the scripts and asserts it has the correct output and exit code
  5. script_run_helper() {
  6. local script="$1"
  7. local expected_output="$2"
  8. local expected_exit_code="${3:-0}"
  9. $script 2>&1 |
  10. grep "$expected_output" >/dev/null 2>&1 && # grep -q flag quits the script early
  11. [ "${PIPESTATUS[0]}" -eq "$expected_exit_code" ]
  12. }