Commit 912ace29 authored by Vojtěch Horký's avatar Vojtěch Horký
Browse files

Add assert_file_exists

parent 9512a4b8
......@@ -78,3 +78,14 @@ assert_status() {
| fail
fi
}
assert_file_exists() {
local filename="$1"
local message="${msg:-File does not exist}"
if ! [ -f "$filename" ]; then
batslib_print_kv_single 4 'path' "$filename" \
| batslib_decorate "$message" \
| fail
fi
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment