aaa/lib/include.sh

21 lines
379 B
Bash
Raw Normal View History

2024-06-06 02:01:36 +02:00
#!/bin/sh
if ! [ $A3_INCLUDE ]; then
A3_INCLUDE=1
A3_INCLUDED=""
2024-06-06 02:10:33 +02:00
A3_LIB=${A3_LIB:-/usr/lib/a3}
2024-06-06 02:01:36 +02:00
is_included() {
echo "$A3_INCLUDED" | grep -q "$1"
}
include() {
[ -z "$1" ] && return 0
is_included $1 && return 0
. $1
A3_INCLUDED="$A3_INCLUDED $1"
}
a3include_lib() {
2024-06-06 02:10:33 +02:00
include $A3_LIB/$1.sh
2024-06-06 02:01:36 +02:00
}
fi