My configuration files for Debian/Ubuntu applications
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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. }