mirror of
https://github.com/denisidoro/navi
synced 2024-11-22 19:43:06 +00:00
25 lines
564 B
Text
25 lines
564 B
Text
|
#!/usr/bin/env bash
|
||
|
set -euo pipefail
|
||
|
|
||
|
export SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||
|
source "${SCRIPT_DIR}/test/core.sh"
|
||
|
|
||
|
check_all_vars() {
|
||
|
local arg
|
||
|
IFS=$'\n'
|
||
|
for var in $(cat "$1" | grep -Eo "<[^>]*>"); do
|
||
|
if ! echo "$var" | grep -qE "$ARG_REGEX"; then
|
||
|
echoerr "$var isn't a valid variable name!"
|
||
|
exit 1
|
||
|
fi
|
||
|
done
|
||
|
}
|
||
|
|
||
|
test::run "We can find at least one known cheatsheet" \
|
||
|
'cheat::find | grep -q "docker.cheat"'
|
||
|
|
||
|
for cheat in $(cheat::find); do
|
||
|
test::run "All variables in $(basename $cheat) are valid" \
|
||
|
'check_all_vars "$cheat"'
|
||
|
done
|