aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Ulloa <pablo.ulloac@usach.cl>2023-09-27 21:45:29 +0300
committerGitHub <noreply@github.com>2023-09-27 21:45:29 +0300
commite7f7d194d634e86b29ed2b74a35dd3c24fa1f7a5 (patch)
tree2c0596d76105b96fbe574407b651c487ca87d584 /src
parent9852ca8888b613daff741b3f26fd7d3b0387b42d (diff)
[common-utils] fix bug when user home is custom by base docker (#703)feature_common-utils_2.2.0
* [common-utils] fix bug when user home is custom by base docker * bumped minor version * reduced conditions to improve readability
Diffstat (limited to 'src')
-rw-r--r--src/common-utils/devcontainer-feature.json2
-rw-r--r--src/common-utils/main.sh3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/common-utils/devcontainer-feature.json b/src/common-utils/devcontainer-feature.json
index 869812b..181e545 100644
--- a/src/common-utils/devcontainer-feature.json
+++ b/src/common-utils/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "common-utils",
- "version": "2.1.3",
+ "version": "2.2.0",
"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 4a048db..7142246 100644
--- a/src/common-utils/main.sh
+++ b/src/common-utils/main.sh
@@ -407,6 +407,9 @@ fi
if [ "${USERNAME}" = "root" ]; then
user_home="/root"
+# Check if user already has a home directory other than /home/${USERNAME}
+elif [ "/home/${USERNAME}" != $( getent passwd $USERNAME | cut -d: -f6 ) ]; then
+ user_home=$( getent passwd $USERNAME | cut -d: -f6 )
else
user_home="/home/${USERNAME}"
if [ ! -d "${user_home}" ]; then