Skip to content

Commit fd5fda8

Browse files
authored
Merge branch 'main' into fix/code_spell_1139
2 parents 3541013 + 125f6b0 commit fd5fda8

7 files changed

Lines changed: 42 additions & 4 deletions

File tree

src/common-utils/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "common-utils",
3-
"version": "2.5.1",
3+
"version": "2.5.2",
44
"name": "Common Utilities",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils",
66
"description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.",

src/common-utils/main.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,9 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
551551

552552
# Add devcontainer .zshrc template
553553
if [ "$INSTALL_OH_MY_ZSH_CONFIG" = "true" ]; then
554-
echo -e "$(cat "${template_path}")\nDISABLE_AUTO_UPDATE=true\nDISABLE_UPDATE_PROMPT=true" > ${user_rc_file}
554+
if ! [ -f "${template_path}" ] || ! grep -qF "$(head -n 1 "${template_path}")" "${user_rc_file}"; then
555+
echo -e "$(cat "${template_path}")\nDISABLE_AUTO_UPDATE=true\nDISABLE_UPDATE_PROMPT=true" > ${user_rc_file}
556+
fi
555557
sed -i -e 's/ZSH_THEME=.*/ZSH_THEME="devcontainers"/g' ${user_rc_file}
556558
fi
557559

src/java/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ find_version_list() {
214214
fi
215215

216216
if [ "${JDK_DISTRO}" = "ms" ]; then
217-
if [ "${major_version}" = "8" ] || [ "${major_version}" = "18" ] || [ "${major_version}" = "22" ]; then
217+
if [ "${major_version}" = "8" ] || [ "${major_version}" = "18" ] || [ "${major_version}" = "22" ] || [ "${major_version}" = "23" ]; then
218218
JDK_DISTRO="tem"
219219
fi
220220
fi
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
check "configure-zshrc-without-overwrite" bash -c "grep 'rbenv init -' ~/.zshrc"
10+
11+
# Report result
12+
reportResults
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM mcr.microsoft.com/devcontainers/ruby:3.2
2+
3+
USER vscode
4+
ENV USER=vscode
5+
RUN echo 'eval "$(rbenv init -)"' >> /home/$USER/.zshrc
6+

test/common-utils/scenarios.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,24 @@
235235
}
236236
}
237237
},
238+
"devcontainer-ruby-zshrc": {
239+
"build": {
240+
"dockerfile": "Dockerfile"
241+
},
242+
"remoteUser": "vscode",
243+
"features": {
244+
"common-utils": {
245+
"installZsh": true,
246+
"username": "vscode",
247+
"userUid": "1000",
248+
"userGid": "1000",
249+
"upgradePackages": true,
250+
"installOhMyZsh": true,
251+
"installOhMyZshConfig": true,
252+
"configureZshAsDefaultShell": true
253+
}
254+
}
255+
},
238256
"alpine-base-zsh-default": {
239257
"image": "mcr.microsoft.com/devcontainers/base:alpine",
240258
"remoteUser": "vscode",

test/java/install_latest_version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ echo 'public class HelloWorld { public static void main(String[] args) { System.
99
javac HelloWorld.java
1010

1111
check "hello world" /bin/bash -c "java HelloWorld | grep "Hello, World!""
12-
check "java version latest installed" grep "22.0.2" <(java --version)
12+
check "java version latest installed" grep "23" <(java --version)
1313

1414
# Report result
1515
reportResults

0 commit comments

Comments
 (0)