CommonUtils - ensure home directory exists. (#398)
* CommonUtils - ensure home directory exists. * Only create non-root home directory Root directory will always exist. * Bump version
This commit is contained in:
parent
74dd2710dc
commit
1726222515
2 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"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
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue