nixos/home-assistant: fix symlinking multi-manifest custom components
frenck/spook includes a second manifest for an integration. The current copyCustomComponents script assumed that only one component directory will be found, which in this case resulted in a malformed symlink destination: lrwxrwxrwx 1 hass hass 224 Jun 23 17:23 spook -> '/nix/store/r41ics22zs578avzqf7x86plcgn2q71h-python3.12-frenck-spook-v3.0.1/custom_components/spook/integrations/spook_inverse'$'\n''/nix/store/r41ics22zs578avzqf7x86plcgn2q71h-python3.12-frenck-spook-v3.0.1/custom_components/spook'
This commit is contained in:
@@ -518,8 +518,9 @@ in {
|
||||
# recreate symlinks for desired components
|
||||
declare -a components=(${escapeShellArgs cfg.customComponents})
|
||||
for component in "''${components[@]}"; do
|
||||
path="$(dirname $(find "$component" -name "manifest.json"))"
|
||||
ln -fns "$path" "${cfg.configDir}/custom_components/"
|
||||
readarray -t manifests < <(find "$component" -name manifest.json)
|
||||
readarray -t paths < <(dirname "''${manifests[@]}")
|
||||
ln -fns "''${paths[@]}" "${cfg.configDir}/custom_components/"
|
||||
done
|
||||
'';
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user