mirror of
https://github.com/aleleba/aleleba-vscode-dockerfile-configuration.git
synced 2025-06-19 12:28:15 -06:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
5dbb07fd80
|
|||
3f6a9f6626
|
|||
13e642be86
|
|||
ba267c2494
|
|||
67cc921484
|
|||
15de59c6e7
|
@ -39,6 +39,17 @@ USER="$HOME_USER"
|
||||
if ! id -u $HOME_USER > /dev/null 2>&1; then
|
||||
sudo adduser --disabled-password --gecos "" ${HOME_USER}
|
||||
sudo echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
|
||||
fi
|
||||
|
||||
# Then execute entrypoint.sh
|
||||
if [ "$HOME_USER" != "$(whoami)" ]; then
|
||||
exec sudo -u $HOME_USER bash -c "source /etc/environment; /usr/bin/entrypoint.sh"
|
||||
|
||||
# Execute the entrypoint.sh script as the user
|
||||
else
|
||||
|
||||
# Change the ownership of the .bashrc file
|
||||
sudo chown ${HOME_USER} /home/${HOME_USER}/.bashrc
|
||||
|
||||
# List all environment variables
|
||||
sudo env |
|
||||
@ -54,11 +65,17 @@ if ! id -u $HOME_USER > /dev/null 2>&1; then
|
||||
do
|
||||
echo "export $line" | sudo tee -a /home/${HOME_USER}/.bashrc
|
||||
done
|
||||
fi
|
||||
|
||||
# Then execute entrypoint.sh
|
||||
if [ "$HOME_USER" != "$(whoami)" ]; then
|
||||
exec sudo -u $HOME_USER bash -c "source /etc/environment; /usr/bin/entrypoint.sh"
|
||||
# Source the .bashrc file to apply the changes immediately
|
||||
sudo su -l ${HOME_USER} -c "source ~/.bashrc"
|
||||
|
||||
# Creating .vscode folder if it doesn't exist
|
||||
if [ ! -d "/home/${HOME_USER}/.vscode" ]; then
|
||||
sudo mkdir -p /home/${HOME_USER}/.vscode
|
||||
fi
|
||||
|
||||
# Changing the property of the directory /home/${HOME_USER}/.vscode
|
||||
sudo chown -R ${HOME_USER}: /home/${HOME_USER}/.vscode
|
||||
fi
|
||||
|
||||
# Find .sh files in /usr/bin/custom-scripts and execute them in order
|
||||
@ -110,8 +127,8 @@ else
|
||||
echo "File extensions.json not found"
|
||||
fi
|
||||
|
||||
if [[ -v VSCODE_TUNNEL_NAME && -z "${VSCODE_TUNNEL_NAME}" ]]; then
|
||||
sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms"
|
||||
else
|
||||
if [[ -v VSCODE_TUNNEL_NAME && -n "${VSCODE_TUNNEL_NAME}" ]]; then
|
||||
sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms --name ${VSCODE_TUNNEL_NAME}"
|
||||
else
|
||||
sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms"
|
||||
fi
|
||||
|
@ -1 +1 @@
|
||||
3.0.4
|
||||
3.0.10
|
Reference in New Issue
Block a user