mirror of
https://github.com/tmux-plugins/tpm.git
synced 2024-11-17 18:08:48 +00:00
14 lines
369 B
Bash
14 lines
369 B
Bash
check_dir_exists_helper() {
|
|
[ -d "$1" ]
|
|
}
|
|
|
|
# runs the scripts and asserts it has the correct output and exit code
|
|
script_run_helper() {
|
|
local script="$1"
|
|
local expected_output="$2"
|
|
local expected_exit_code="${3:-0}"
|
|
"$script" |
|
|
grep "$expected_output" >/dev/null 2>&1 && # grep -q flag quits the script early
|
|
[ "${PIPESTATUS[0]}" -eq "$expected_exit_code" ]
|
|
}
|