Fix a minor issue. this prevent runtime issue if a file is mounted in home dir, like .ssh.
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing

This commit is contained in:
Ameer Hamza Khan
2025-07-27 16:11:56 +00:00
parent 8dd84546a7
commit 6802f963d0

View File

@@ -38,14 +38,9 @@ trap 'term_handler' SIGTERM SIGINT
# setup home directory for the current user. It is useful for attaching vscode with container.
user_name=$(whoami)
user_home="/home/$user_name"
# Only create home directory if it doesn't exist (handles mounted /etc/passwd case)
if [[ ! -d "$user_home" ]]; then
sudo mkdir -p "$user_home"
sudo chown -R "$(id -u):$(id -g)" "$user_home"
# Copy skeleton files only if home directory was created
cp -r /etc/skel/. "$user_home" 2>/dev/null || true
fi
sudo mkdir -p "$user_home"
sudo chown -R "$(id -u):$(id -g)" "$user_home"
cp -r /etc/skel/. "$user_home" 2>/dev/null || true
if [[ $LOG_FILE != "/dev/null" ]]; then
sudo touch "$LOG_FILE"