Skip to content

Commit 10e9478

Browse files
committed
Use root user when username is not present
1 parent 0278741 commit 10e9478

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

.devcontainer/scripts/create-user.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ USERNAME=${1}
33
USER_UID=${2}
44
USER_GID=${3}
55

6-
if [ $USERNAME == "" ]; then
7-
exit 0
6+
if [ ! -z "$USERNAME" ]; then
7+
# Create the user
8+
addgroup --gid $USER_GID $USERNAME
9+
adduser --uid $USER_UID --gid $USER_GID --disabled-password $USERNAME
810
fi
9-
10-
# Create the user
11-
addgroup --gid $USER_GID $USERNAME
12-
adduser --uid $USER_UID --gid $USER_GID --disabled-password $USERNAME

git-hooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ stash_push() {
88
}
99

1010
stash_pop() {
11-
git apply --whitespace=nowarn < /tmp/$STASH_NAME
11+
git apply --whitespace=nowarn < /tmp/$STASH_NAME 2> /dev/null
1212
rm /tmp/$STASH_NAME
1313
if [ -n "$STASH_NUM" ]; then
1414
git stash drop -q stash@{$STASH_NUM}

0 commit comments

Comments
 (0)