Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
fix: further improve portability of login-profile.sh
Browse files Browse the repository at this point in the history
The `-d ""` check is false on bash and zsh, but there might be some rare shell out there which treats it as "." or similar, so let's guard against that risk by also verifying that `$HOME` is a non-empty string before we check if it's a directory.
  • Loading branch information
Arcitec authored and xynydev committed May 14, 2023
1 parent cec7397 commit 4318180
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usr/share/ublue-os/firstboot/launcher/login-profile.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Only process users with home directories, but skip the "root" user.
if [ "$(id -u)" != "0" ] && [ -d "$HOME" ]; then
if [ "$(id -u)" != "0" ] && [ ! -z "$HOME" ] && [ -d "$HOME" ]; then
# Ensure target file exists and is a symlink (not a regular file or dir).
if [ ! -L "$HOME"/.config/autostart/ublue-firstboot.desktop ]; then
# Remove any leftovers or incorrect (non-link) files with the same name.
Expand Down

0 comments on commit 4318180

Please sign in to comment.