aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen A. Imhoff <clockwork-muse@outlook.com>2023-01-13 22:05:53 +0300
committerGitHub <noreply@github.com>2023-01-13 22:05:53 +0300
commit1726222515e9d03c05f48bb4a03895afd09525a7 (patch)
tree814c2ee52630e55c93c2df385ae919b5c10b16dc
parent74dd2710dc77b85d6ad72c4534f4c7d7f67b86b2 (diff)
CommonUtils - ensure home directory exists. (#398)
* CommonUtils - ensure home directory exists. * Only create non-root home directory Root directory will always exist. * Bump version
-rw-r--r--src/common-utils/devcontainer-feature.json2
-rw-r--r--src/common-utils/main.sh4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/common-utils/devcontainer-feature.json b/src/common-utils/devcontainer-feature.json
index 36c87bc..03b2fe3 100644
--- a/src/common-utils/devcontainer-feature.json
+++ b/src/common-utils/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "common-utils",
- "version": "2.0.6",
+ "version": "2.0.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.",
diff --git a/src/common-utils/main.sh b/src/common-utils/main.sh
index ff2c54c..893f53a 100644
--- a/src/common-utils/main.sh
+++ b/src/common-utils/main.sh
@@ -383,6 +383,10 @@ if [ "${USERNAME}" = "root" ]; then
user_rc_path="/root"
else
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
# Restore user .bashrc / .profile / .zshrc defaults from skeleton file if it doesn't exist or is empty