mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
054c5f0e10
Always specify the preDistPhases attribute as a list instead of a string. Append elements to the preDistPhases Bash variable using appendToVar instead of string or Bash array concatenation. Handle element insertion before a specific element using string substitution as before, but handle both structured and unstructured attributes.
26 lines
741 B
Bash
26 lines
741 B
Bash
# Setup hook to check HA manifest requirements
|
|
echo "Sourcing manifest-requirements-check-hook"
|
|
|
|
function manifestCheckPhase() {
|
|
echo "Executing manifestCheckPhase"
|
|
runHook preCheck
|
|
|
|
manifests=$(shopt -s nullglob; echo $out/custom_components/*/manifest.json)
|
|
|
|
if [ ! -z "$manifests" ]; then
|
|
echo Checking manifests $manifests
|
|
@pythonCheckInterpreter@ @checkManifest@ $manifests
|
|
else
|
|
echo "No custom component manifests found in $out" >&2
|
|
exit 1
|
|
fi
|
|
|
|
runHook postCheck
|
|
echo "Finished executing manifestCheckPhase"
|
|
}
|
|
|
|
if [ -z "${dontCheckManifest-}" ] && [ -z "${installCheckPhase-}" ]; then
|
|
echo "Using manifestCheckPhase"
|
|
appendToVar preDistPhases manifestCheckPhase
|
|
fi
|