Skip to content

Commit

Permalink
safe directory only for enable community
Browse files Browse the repository at this point in the history
  • Loading branch information
maci3jka committed Oct 23, 2024
1 parent e57c702 commit 522c444
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions microk8s-resources/wrappers/microk8s-enable.wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ exit_if_not_root

exit_if_no_permissions

if [ "$EUID" -ne 0 ]
if [ "$EUID" -ne 0 ] && [[ "${@}" == "community" ]]
then
export GIT_DIR=/tmp/config-$(cat /proc/sys/kernel/random/uuid)
mkdir -p ${GIT_DIR}
cat > ${GIT_DIR}/.gitconfig << EOF
[safe]
directory = $SNAP/addons/community/*
directory = $SNAP/addons/community
EOF
fi

${SNAP}/usr/bin/python3 ${SNAP}/scripts/wrappers/enable.py "${@}"

if [ "$EUID" -ne 0 ]
if [ "$EUID" -ne 0 ] && [[ "${@}" == "community" ]]
then
rm -rf ${GIT_DIR}
unset GIT_DIR
Expand Down

0 comments on commit 522c444

Please sign in to comment.