home-assistant-core/script/setup

40 lines
935 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
# Setups the repository.
# Stop on errors
set -e
cd "$(dirname "$0")/.."
2020-06-25 18:34:47 +00:00
# Add default vscode settings if not existing
SETTINGS_FILE=./.vscode/settings.json
SETTINGS_TEMPLATE_FILE=./.vscode/settings.default.json
if [ ! -f "$SETTINGS_FILE" ]; then
echo "Copy $SETTINGS_TEMPLATE_FILE to $SETTINGS_FILE."
cp "$SETTINGS_TEMPLATE_FILE" "$SETTINGS_FILE"
fi
2020-06-25 18:34:47 +00:00
mkdir -p config
if [ ! -n "$DEVCONTAINER" ] && [ ! -n "$VIRTUAL_ENV" ];then
python3 -m venv venv
source venv/bin/activate
fi
2020-06-25 18:34:47 +00:00
script/bootstrap
2019-07-30 23:59:12 +00:00
pre-commit install
2023-06-26 17:03:56 +00:00
python3 -m pip install -e . --config-settings editable_mode=compat --constraint homeassistant/package_constraints.txt
python3 -m script.translations develop --all
2020-06-25 18:34:47 +00:00
hass --script ensure_config -c config
if ! grep -R "logger" config/configuration.yaml >> /dev/null;then
2020-06-25 18:34:47 +00:00
echo "
logger:
default: info
logs:
homeassistant.components.cloud: debug
" >> config/configuration.yaml
fi