fix(nix/greeter): skip invalid customThemeFile in preStart (#1997)

* fix(nix/greeter): skip invalid customThemeFile in preStart

Avoid attempting to copy a null/empty/missing customThemeFile path by validating the jq result and file existence before cp.

Update distro/nix/greeter.nix

Co-authored-by: Lucas <[email protected]>

* nix/greeter: update customTheme verification

---------

Co-authored-by: Lucas <[email protected]>
Co-authored-by: LuckShiba <[email protected]>
This commit is contained in:
authored and bbedward committed 2026-03-19 19:55:35 -04:00
1 parent 720ec07d13
commit c647eafadc
1 file changed
+3 -1
+3 -1
View File
@@ -180,7 +180,9 @@ in
fi
if [ -f settings.json ]; then
if cp "$(${jq} -r '.customThemeFile' settings.json)" custom-theme.json; then
theme_file="$(${jq} -r '.customThemeFile // empty' settings.json)"
if [ -f "$theme_file" ] && [ -r "$theme_file" ]; then
cp "$theme_file" custom-theme.json
mv settings.json settings.orig.json
${jq} '.customThemeFile = "${cacheDir}/custom-theme.json"' settings.orig.json > settings.json
fi