From 80d7b87463a683f5aac2fea4b889c4862f347426 Mon Sep 17 00:00:00 2001 From: Romain Avouac <43444134+avouacr@users.noreply.github.com> Date: Tue, 12 Nov 2024 14:24:19 +0100 Subject: [PATCH] fix(onyxia-init): give user permissions on git's config files --- scripts/onyxia-init.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/onyxia-init.sh b/scripts/onyxia-init.sh index 4b69af40..4515a9cc 100644 --- a/scripts/onyxia-init.sh +++ b/scripts/onyxia-init.sh @@ -122,7 +122,6 @@ if [ "`which git`" != "" ]; then done cd $HOME fi - fi fi @@ -141,6 +140,11 @@ if [ "`which git`" != "" ]; then if [ -n "$GIT_CREDENTIALS_CACHE_DURATION" ]; then git config --"$git_config" credential.helper "cache --timeout=$GIT_CREDENTIALS_CACHE_DURATION" fi + + # Fix permissions + [ -d ~/.cache/git ] && chown -R ${USERNAME}:${GROUPNAME} ~/.cache/git + [ -f ~/.gitconfig ] && chown ${USERNAME}:${GROUPNAME} ~/.gitconfig + fi if command -v R; then