Merge pull request #275554 from SuperSandro2000/home-assistant-custom-components-fix-unlink
nixos/home-assistant: fix removing of uninstalled custom components
This commit is contained in:
commit
d12a0b7861
@ -468,8 +468,8 @@ in {
|
|||||||
mkdir -p "${cfg.configDir}/custom_components"
|
mkdir -p "${cfg.configDir}/custom_components"
|
||||||
|
|
||||||
# remove components symlinked in from below the /nix/store
|
# remove components symlinked in from below the /nix/store
|
||||||
components="$(find "${cfg.configDir}/custom_components" -maxdepth 1 -type l)"
|
readarray -d "" components < <(find "${cfg.configDir}/custom_components" -maxdepth 1 -type l -print0)
|
||||||
for component in "$components"; do
|
for component in "''${components[@]}"; do
|
||||||
if [[ "$(readlink "$component")" =~ ^${escapeShellArg builtins.storeDir} ]]; then
|
if [[ "$(readlink "$component")" =~ ^${escapeShellArg builtins.storeDir} ]]; then
|
||||||
rm "$component"
|
rm "$component"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user