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

Commit e60bdc4

Browse files
author
CI
committed
Automated update for script library changes
1 parent 8f18e4f commit e60bdc4

File tree

34 files changed

+204
-170
lines changed

34 files changed

+204
-170
lines changed

container-templates/docker-compose/.devcontainer/library-scripts/common-debian.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-
180180
fi
181181

182182
# Create or update a non-root user to match UID/GID.
183+
group_name="${USERNAME}"
183184
if id -u ${USERNAME} > /dev/null 2>&1; then
184185
# User exists, update if needed
185186
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
186-
default_group_name="$(id -gn $USERNAME)"
187-
groupmod --gid $USER_GID ${default_group}
187+
group_name="$(id -gn $USERNAME)"
188+
groupmod --gid $USER_GID ${group_name}
188189
usermod --gid $USER_GID $USERNAME
189190
fi
190191
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
@@ -335,7 +336,7 @@ __zsh_prompt() {
335336
fi
336337
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
337338
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
338-
PROMPT+='$([ $(git config --get codespaces-theme.hide-status 2>/dev/null) != 1 ] && git_prompt_info)' # Git status
339+
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
339340
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
340341
unset -f __zsh_prompt
341342
}
@@ -357,7 +358,7 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
357358
echo "${codespaces_bash}" >> "/root/.bashrc"
358359
echo 'export PROMPT_DIRTRIM=4' >> "/root/.bashrc"
359360
fi
360-
chown ${USERNAME}:${USERNAME} "${user_rc_path}/.bashrc"
361+
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
361362
RC_SNIPPET_ALREADY_ADDED="true"
362363
fi
363364

@@ -398,7 +399,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
398399
# Copy to non-root user if one is specified
399400
if [ "${USERNAME}" != "root" ]; then
400401
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
401-
chown -R ${USERNAME}:${USERNAME} "${user_rc_path}"
402+
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
402403
fi
403404
fi
404405
fi

container-templates/dockerfile/.devcontainer/library-scripts/common-debian.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-
180180
fi
181181

182182
# Create or update a non-root user to match UID/GID.
183+
group_name="${USERNAME}"
183184
if id -u ${USERNAME} > /dev/null 2>&1; then
184185
# User exists, update if needed
185186
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
186-
default_group_name="$(id -gn $USERNAME)"
187-
groupmod --gid $USER_GID ${default_group}
187+
group_name="$(id -gn $USERNAME)"
188+
groupmod --gid $USER_GID ${group_name}
188189
usermod --gid $USER_GID $USERNAME
189190
fi
190191
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
@@ -335,7 +336,7 @@ __zsh_prompt() {
335336
fi
336337
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
337338
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
338-
PROMPT+='$([ $(git config --get codespaces-theme.hide-status 2>/dev/null) != 1 ] && git_prompt_info)' # Git status
339+
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
339340
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
340341
unset -f __zsh_prompt
341342
}
@@ -357,7 +358,7 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
357358
echo "${codespaces_bash}" >> "/root/.bashrc"
358359
echo 'export PROMPT_DIRTRIM=4' >> "/root/.bashrc"
359360
fi
360-
chown ${USERNAME}:${USERNAME} "${user_rc_path}/.bashrc"
361+
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
361362
RC_SNIPPET_ALREADY_ADDED="true"
362363
fi
363364

@@ -398,7 +399,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
398399
# Copy to non-root user if one is specified
399400
if [ "${USERNAME}" != "root" ]; then
400401
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
401-
chown -R ${USERNAME}:${USERNAME} "${user_rc_path}"
402+
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
402403
fi
403404
fi
404405
fi

containers/alpine/.devcontainer/library-scripts/common-alpine.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,12 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
118118
fi
119119

120120
# Create or update a non-root user to match UID/GID.
121+
group_name="${USERNAME}"
121122
if id -u ${USERNAME} > /dev/null 2>&1; then
122123
# User exists, update if needed
123124
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
124-
default_group_name="$(id -gn $USERNAME)"
125-
groupmod --gid $USER_GID ${default_group}
125+
group_name="$(id -gn $USERNAME)"
126+
groupmod --gid $USER_GID ${group_name}
126127
usermod --gid $USER_GID $USERNAME
127128
fi
128129
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
@@ -251,7 +252,7 @@ __zsh_prompt() {
251252
fi
252253
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
253254
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
254-
PROMPT+='$([ $(git config --get codespaces-theme.hide-status 2>/dev/null) != 1 ] && git_prompt_info)' # Git status
255+
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
255256
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
256257
unset -f __zsh_prompt
257258
}
@@ -270,7 +271,7 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
270271
if [ "${USERNAME}" != "root" ]; then
271272
echo -e "${rc_snippet}\n${codespaces_bash}" >> "/root/.bashrc"
272273
fi
273-
chown ${USERNAME}:${USERNAME} "${user_rc_path}/.bashrc"
274+
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
274275
RC_SNIPPET_ALREADY_ADDED="true"
275276
fi
276277

@@ -309,7 +310,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
309310
# Copy to non-root user if one is specified
310311
if [ "${USERNAME}" != "root" ]; then
311312
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
312-
chown -R ${USERNAME}:${USERNAME} "${user_rc_path}"
313+
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
313314
fi
314315
fi
315316
fi

containers/azure-ansible/.devcontainer/library-scripts/common-debian.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-
180180
fi
181181

182182
# Create or update a non-root user to match UID/GID.
183+
group_name="${USERNAME}"
183184
if id -u ${USERNAME} > /dev/null 2>&1; then
184185
# User exists, update if needed
185186
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
186-
default_group_name="$(id -gn $USERNAME)"
187-
groupmod --gid $USER_GID ${default_group}
187+
group_name="$(id -gn $USERNAME)"
188+
groupmod --gid $USER_GID ${group_name}
188189
usermod --gid $USER_GID $USERNAME
189190
fi
190191
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
@@ -335,7 +336,7 @@ __zsh_prompt() {
335336
fi
336337
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
337338
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
338-
PROMPT+='$([ $(git config --get codespaces-theme.hide-status 2>/dev/null) != 1 ] && git_prompt_info)' # Git status
339+
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
339340
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
340341
unset -f __zsh_prompt
341342
}
@@ -357,7 +358,7 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
357358
echo "${codespaces_bash}" >> "/root/.bashrc"
358359
echo 'export PROMPT_DIRTRIM=4' >> "/root/.bashrc"
359360
fi
360-
chown ${USERNAME}:${USERNAME} "${user_rc_path}/.bashrc"
361+
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
361362
RC_SNIPPET_ALREADY_ADDED="true"
362363
fi
363364

@@ -398,7 +399,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
398399
# Copy to non-root user if one is specified
399400
if [ "${USERNAME}" != "root" ]; then
400401
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
401-
chown -R ${USERNAME}:${USERNAME} "${user_rc_path}"
402+
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
402403
fi
403404
fi
404405
fi

containers/azure-bicep/.devcontainer/library-scripts/common-debian.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-
180180
fi
181181

182182
# Create or update a non-root user to match UID/GID.
183+
group_name="${USERNAME}"
183184
if id -u ${USERNAME} > /dev/null 2>&1; then
184185
# User exists, update if needed
185186
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
186-
default_group_name="$(id -gn $USERNAME)"
187-
groupmod --gid $USER_GID ${default_group}
187+
group_name="$(id -gn $USERNAME)"
188+
groupmod --gid $USER_GID ${group_name}
188189
usermod --gid $USER_GID $USERNAME
189190
fi
190191
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
@@ -335,7 +336,7 @@ __zsh_prompt() {
335336
fi
336337
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
337338
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
338-
PROMPT+='$([ $(git config --get codespaces-theme.hide-status 2>/dev/null) != 1 ] && git_prompt_info)' # Git status
339+
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
339340
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
340341
unset -f __zsh_prompt
341342
}
@@ -357,7 +358,7 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
357358
echo "${codespaces_bash}" >> "/root/.bashrc"
358359
echo 'export PROMPT_DIRTRIM=4' >> "/root/.bashrc"
359360
fi
360-
chown ${USERNAME}:${USERNAME} "${user_rc_path}/.bashrc"
361+
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
361362
RC_SNIPPET_ALREADY_ADDED="true"
362363
fi
363364

@@ -398,7 +399,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
398399
# Copy to non-root user if one is specified
399400
if [ "${USERNAME}" != "root" ]; then
400401
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
401-
chown -R ${USERNAME}:${USERNAME} "${user_rc_path}"
402+
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
402403
fi
403404
fi
404405
fi

containers/azure-cli/.devcontainer/library-scripts/common-debian.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-
180180
fi
181181

182182
# Create or update a non-root user to match UID/GID.
183+
group_name="${USERNAME}"
183184
if id -u ${USERNAME} > /dev/null 2>&1; then
184185
# User exists, update if needed
185186
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
186-
default_group_name="$(id -gn $USERNAME)"
187-
groupmod --gid $USER_GID ${default_group}
187+
group_name="$(id -gn $USERNAME)"
188+
groupmod --gid $USER_GID ${group_name}
188189
usermod --gid $USER_GID $USERNAME
189190
fi
190191
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
@@ -335,7 +336,7 @@ __zsh_prompt() {
335336
fi
336337
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
337338
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
338-
PROMPT+='$([ $(git config --get codespaces-theme.hide-status 2>/dev/null) != 1 ] && git_prompt_info)' # Git status
339+
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
339340
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
340341
unset -f __zsh_prompt
341342
}
@@ -357,7 +358,7 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
357358
echo "${codespaces_bash}" >> "/root/.bashrc"
358359
echo 'export PROMPT_DIRTRIM=4' >> "/root/.bashrc"
359360
fi
360-
chown ${USERNAME}:${USERNAME} "${user_rc_path}/.bashrc"
361+
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
361362
RC_SNIPPET_ALREADY_ADDED="true"
362363
fi
363364

@@ -398,7 +399,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
398399
# Copy to non-root user if one is specified
399400
if [ "${USERNAME}" != "root" ]; then
400401
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
401-
chown -R ${USERNAME}:${USERNAME} "${user_rc_path}"
402+
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
402403
fi
403404
fi
404405
fi

containers/azure-functions-dotnetcore-2.1/.devcontainer/library-scripts/common-debian.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-
180180
fi
181181

182182
# Create or update a non-root user to match UID/GID.
183+
group_name="${USERNAME}"
183184
if id -u ${USERNAME} > /dev/null 2>&1; then
184185
# User exists, update if needed
185186
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
186-
default_group_name="$(id -gn $USERNAME)"
187-
groupmod --gid $USER_GID ${default_group}
187+
group_name="$(id -gn $USERNAME)"
188+
groupmod --gid $USER_GID ${group_name}
188189
usermod --gid $USER_GID $USERNAME
189190
fi
190191
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
@@ -335,7 +336,7 @@ __zsh_prompt() {
335336
fi
336337
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
337338
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
338-
PROMPT+='$([ $(git config --get codespaces-theme.hide-status 2>/dev/null) != 1 ] && git_prompt_info)' # Git status
339+
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
339340
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
340341
unset -f __zsh_prompt
341342
}
@@ -357,7 +358,7 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
357358
echo "${codespaces_bash}" >> "/root/.bashrc"
358359
echo 'export PROMPT_DIRTRIM=4' >> "/root/.bashrc"
359360
fi
360-
chown ${USERNAME}:${USERNAME} "${user_rc_path}/.bashrc"
361+
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
361362
RC_SNIPPET_ALREADY_ADDED="true"
362363
fi
363364

@@ -398,7 +399,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
398399
# Copy to non-root user if one is specified
399400
if [ "${USERNAME}" != "root" ]; then
400401
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
401-
chown -R ${USERNAME}:${USERNAME} "${user_rc_path}"
402+
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
402403
fi
403404
fi
404405
fi

containers/azure-terraform/.devcontainer/library-scripts/common-debian.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-
180180
fi
181181

182182
# Create or update a non-root user to match UID/GID.
183+
group_name="${USERNAME}"
183184
if id -u ${USERNAME} > /dev/null 2>&1; then
184185
# User exists, update if needed
185186
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
186-
default_group_name="$(id -gn $USERNAME)"
187-
groupmod --gid $USER_GID ${default_group}
187+
group_name="$(id -gn $USERNAME)"
188+
groupmod --gid $USER_GID ${group_name}
188189
usermod --gid $USER_GID $USERNAME
189190
fi
190191
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
@@ -335,7 +336,7 @@ __zsh_prompt() {
335336
fi
336337
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
337338
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
338-
PROMPT+='$([ $(git config --get codespaces-theme.hide-status 2>/dev/null) != 1 ] && git_prompt_info)' # Git status
339+
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
339340
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
340341
unset -f __zsh_prompt
341342
}
@@ -357,7 +358,7 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
357358
echo "${codespaces_bash}" >> "/root/.bashrc"
358359
echo 'export PROMPT_DIRTRIM=4' >> "/root/.bashrc"
359360
fi
360-
chown ${USERNAME}:${USERNAME} "${user_rc_path}/.bashrc"
361+
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
361362
RC_SNIPPET_ALREADY_ADDED="true"
362363
fi
363364

@@ -398,7 +399,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
398399
# Copy to non-root user if one is specified
399400
if [ "${USERNAME}" != "root" ]; then
400401
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
401-
chown -R ${USERNAME}:${USERNAME} "${user_rc_path}"
402+
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
402403
fi
403404
fi
404405
fi

containers/bazel/.devcontainer/library-scripts/common-debian.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-
180180
fi
181181

182182
# Create or update a non-root user to match UID/GID.
183+
group_name="${USERNAME}"
183184
if id -u ${USERNAME} > /dev/null 2>&1; then
184185
# User exists, update if needed
185186
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
186-
default_group_name="$(id -gn $USERNAME)"
187-
groupmod --gid $USER_GID ${default_group}
187+
group_name="$(id -gn $USERNAME)"
188+
groupmod --gid $USER_GID ${group_name}
188189
usermod --gid $USER_GID $USERNAME
189190
fi
190191
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
@@ -335,7 +336,7 @@ __zsh_prompt() {
335336
fi
336337
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
337338
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
338-
PROMPT+='$([ $(git config --get codespaces-theme.hide-status 2>/dev/null) != 1 ] && git_prompt_info)' # Git status
339+
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
339340
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
340341
unset -f __zsh_prompt
341342
}
@@ -357,7 +358,7 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
357358
echo "${codespaces_bash}" >> "/root/.bashrc"
358359
echo 'export PROMPT_DIRTRIM=4' >> "/root/.bashrc"
359360
fi
360-
chown ${USERNAME}:${USERNAME} "${user_rc_path}/.bashrc"
361+
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
361362
RC_SNIPPET_ALREADY_ADDED="true"
362363
fi
363364

@@ -398,7 +399,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
398399
# Copy to non-root user if one is specified
399400
if [ "${USERNAME}" != "root" ]; then
400401
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
401-
chown -R ${USERNAME}:${USERNAME} "${user_rc_path}"
402+
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
402403
fi
403404
fi
404405
fi

0 commit comments

Comments
 (0)