make the hooks usable by the whole catalogue
- hooks load the _stack files of every directory between the stack path root and the stack, outermost first: make included both $(dir)/*.mk and $(dir)/*/*.mk, so a stack in a subdirectory saw its parent's settings - a group may be declared in <group>/<group>.env, where the stack lives - MYOS_STACK_DIR lets a hook read a file it ships next to itself - myos_filter no longer confuses a literal * in a make pattern with a wildcard, and the list helpers no longer let the shell expand a * into filenames - MACHINE, SYSTEM, HOST and DOMAINNAME join the framework variables a hook sees - the make shim gains $(call myos-var,NAME), so a .mk target can read a setting that now lives in a hook, and it picks up the .mk of every stack directory rather than only the project's
This commit is contained in:
@@ -5,6 +5,7 @@ Include lib/var.sh
|
||||
Include lib/tags.sh
|
||||
Include lib/naming.sh
|
||||
Include lib/config.sh
|
||||
Include lib/stack.sh
|
||||
Include lib/hooks.sh
|
||||
|
||||
# A stack ships its computed settings as a shell hook, so the catalogue works
|
||||
@@ -14,6 +15,7 @@ Describe 'lib/hooks.sh'
|
||||
MYOS_TMP=$(mktemp -d "${TMPDIR:-/tmp}/myos-hook.XXXXXX")
|
||||
MYOS_TMP=$(cd "$MYOS_TMP" && pwd -P)
|
||||
ENV=local; DOMAIN=example.org; USER=tester; HOSTNAME=testhost
|
||||
MYOS_PATH=$MYOS_TMP
|
||||
APP_HOST=demo.example.org; APP_URI=demo.example.org/
|
||||
}
|
||||
cleanup() { rm -rf "$MYOS_TMP"; }
|
||||
|
||||
Reference in New Issue
Block a user