Unverified Commit 17262225 authored by Stephen A. Imhoff's avatar Stephen A. Imhoff Committed by GitHub

CommonUtils - ensure home directory exists. (#398)

* CommonUtils - ensure home directory exists.

* Only create non-root home directory

Root directory will always exist.

* Bump version
parent 74dd2710
{ {
"id": "common-utils", "id": "common-utils",
"version": "2.0.6", "version": "2.0.7",
"name": "Common Utilities", "name": "Common Utilities",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils", "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.", "description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.",
......
...@@ -383,6 +383,10 @@ if [ "${USERNAME}" = "root" ]; then ...@@ -383,6 +383,10 @@ if [ "${USERNAME}" = "root" ]; then
user_rc_path="/root" user_rc_path="/root"
else else
user_rc_path="/home/${USERNAME}" user_rc_path="/home/${USERNAME}"
if [ ! -d "${user_rc_path}" ]; then
mkdir -p "${user_rc_path}"
chown ${USERNAME}:${group_name} "${user_rc_path}"
fi
fi fi
# Restore user .bashrc / .profile / .zshrc defaults from skeleton file if it doesn't exist or is empty # Restore user .bashrc / .profile / .zshrc defaults from skeleton file if it doesn't exist or is empty
......
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