From f9503fe8272558a65e7ece8fe0d35f38214e4b33 Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Wed, 10 Apr 2024 06:23:37 +0000 Subject: [PATCH] Trying to fix user. Updating to version 2.0.37 --- entrypoint.sh | 17 +++++++++-------- version.txt | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6f3cd30..0c1399a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -29,15 +29,16 @@ if [ "${HOME_USER-}" ]; then sudo chown ${HOME_USER} /home/${HOME_USER}/.bashrc # Copy environment variables from vscode user to HOME_USER - env | grep -v 'HOME_USER' | while read -r line; do - sudo su - ${HOME_USER} -c "echo 'export $line' >> ~/.bashrc" - done + # env | grep -v 'HOME_USER' | while read -r line; do + # sudo su - ${HOME_USER} -c "echo 'export $line' >> ~/.bashrc" + # done - # Get the PATH of vscode user - VSCODE_PATH=$(sudo -u vscode -i echo $PATH) + # Copy the PATH variable from vscode user to HOME_USER + #PATH_LINE=$(grep "^PATH=" /home/vscode/.bashrc) + #sudo su - ${HOME_USER} -c "echo '${PATH_LINE}' >> ~/.bashrc" - # Add the PATH to the .bashrc of HOME_USER - sudo su - ${HOME_USER} -c "echo 'export PATH=$VSCODE_PATH' >> ~/.bashrc" + # Copy the .bashrc file from vscode user to HOME_USER + sudo su - ${HOME_USER} -c "cat /home/vscode/.bashrc >> ~/.bashrc" # Changing the property of the directory /home/${HOME_USER} sudo chown -R ${HOME_USER}: /home/${HOME_USER}/ @@ -46,7 +47,7 @@ if [ "${HOME_USER-}" ]; then sudo su - ${HOME_USER} -c 'sed -i "s|/home/vscode|/home/${HOME_USER}|g" ~/.bashrc' # Switch to the user specified by $HOME_USER and start an interactive shell session. - sudo -u $HOME_USER -i + sudo su -l ${HOME_USER} fi fi diff --git a/version.txt b/version.txt index 59bc116..67478f2 100755 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.0.36 \ No newline at end of file +2.0.37 \ No newline at end of file