Unverified Commit 28ca71a1 authored by Samruddhi Khandale's avatar Samruddhi Khandale Committed by GitHub

Revert "common-utils overwrites .zshrc coming from image built" (#1094)

* Revert "common-utils overwrites .zshrc coming from image built (#1069)"

This reverts commit 56233fda.

* Update devcontainer-feature.json
parent b2c7d17f
{
"id": "common-utils",
"version": "2.4.6",
"version": "2.4.7",
"name": "Common Utilities",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils",
"description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.",
......
......@@ -491,6 +491,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
echo 'source $HOME/.profile' >> "${user_home}/.zprofile" # TODO: Reconsider adding '.profile' to '.zprofile'
chown ${USERNAME}:${group_name} "${user_home}/.zprofile"
fi
if [ "${ZSH_ALREADY_INSTALLED}" != "true" ]; then
if [ "${ADJUSTED_ID}" = "rhel" ]; then
global_rc_path="/etc/zshrc"
......@@ -542,8 +543,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
# Add devcontainer .zshrc template
if [ "$INSTALL_OH_MY_ZSH_CONFIG" = "true" ]; then
template_code="$(cat "${template_path}")\nDISABLE_AUTO_UPDATE=true\nDISABLE_UPDATE_PROMPT=true"
echo -e "$([ -f "${user_rc_file}" ] && cat "${user_rc_file}")\n${template_code}" > "${user_rc_file}"
echo -e "$(cat "${template_path}")\nDISABLE_AUTO_UPDATE=true\nDISABLE_UPDATE_PROMPT=true" > ${user_rc_file}
sed -i -e 's/ZSH_THEME=.*/ZSH_THEME="devcontainers"/g' ${user_rc_file}
fi
......
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Definition specific tests
check "configure-zshrc-without-overwrite" bash -c "grep 'rbenv init -' ~/.zshrc"
# Report result
reportResults
FROM mcr.microsoft.com/devcontainers/ruby:3.2
RUN echo 'eval "$(rbenv init -)"' >> /home/vscode/.zshrc
VERSION='test-version'
DEFINITION_ID='test-id'
VARIANT='test-variant'
GIT_REPOSITORY='test-repository'
GIT_REPOSITORY_RELEASE='test-release'
GIT_REPOSITORY_REVISION='test-revision'
BUILD_TIMESTAMP='test-time'
CONTENTS_URL='test-url'
......@@ -235,24 +235,6 @@
}
}
},
"devcontainer-ruby-zshrc": {
"build": {
"dockerfile": "Dockerfile"
},
"remoteUser": "vscode",
"features": {
"common-utils": {
"installZsh": true,
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": true,
"installOhMyZsh": true,
"installOhMyZshConfig": true,
"configureZshAsDefaultShell": true
}
}
},
"alpine-base-zsh-default": {
"image": "mcr.microsoft.com/devcontainers/base:alpine",
"remoteUser": "vscode",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment