look for the catalogue beside the installation too

An install under a custom prefix (--prefix ~/.local) could not find the
catalogue it had just cloned into <prefix>/share/myos: only the three system
paths were searched.
This commit is contained in:
Yann Autissier
2026-09-03 18:49:22 +02:00
parent 32e2624245
commit c08c379565
3 changed files with 134 additions and 1 deletions
+22
View File
@@ -168,3 +168,25 @@ Describe 'lib/stack.sh group safety'
The lines of output should equal 2
End
End
Describe 'lib/stack.sh installation prefix'
setup() {
MYOS_TMP=$(mktemp -d "${TMPDIR:-/tmp}/myos-prefix.XXXXXX")
# myos resolves stack paths physically, so compare against the physical path
MYOS_TMP=$(cd "$MYOS_TMP" && pwd -P)
mkdir -p "$MYOS_TMP/lib/myos" "$MYOS_TMP/share/myos/stack/demo"
: > "$MYOS_TMP/share/myos/stack/demo/demo.yml"
MYOS_ROOT=$MYOS_TMP/lib/myos
WORKDIR=$MYOS_TMP
HOME=$MYOS_TMP/nohome
MYOS_PATH=
}
cleanup() { rm -rf "$MYOS_TMP"; }
BeforeEach setup
AfterEach cleanup
It 'finds the catalogue installed beside the framework'
When call myos_stack_resolve demo
The output should equal "$MYOS_TMP/share/myos/stack/demo"
End
End