From 899aa31df3394720db98cc49e5f920ae12e33284 Mon Sep 17 00:00:00 2001 From: Dave T <17680170+davet2001@users.noreply.github.com> Date: Sun, 16 Jul 2023 22:19:08 +0100 Subject: [PATCH] Mark repo as safe directory to git config (#5102) --- script/setup | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/setup b/script/setup index e1b5941d0e..ba3b544352 100755 --- a/script/setup +++ b/script/setup @@ -10,6 +10,11 @@ if [ ! -n "$DEVCONTAINER" ] && [ ! -n "$VIRTUAL_ENV" ] && [ ! "$ESPHOME_NO_VENV" source venv/bin/activate fi +# Avoid unsafe git error when running inside devcontainer +if [ -n "$DEVCONTAINER" ];then + git config --global --add safe.directory "$PWD" +fi + pip3 install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt pip3 install setuptools wheel pip3 install --no-use-pep517 -e .