2020-07-17 16:27:46 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-01-02 21:04:09 +00:00
|
|
|
# Setups the repository.
|
|
|
|
|
|
|
|
# Stop on errors
|
|
|
|
set -e
|
2015-09-17 07:35:26 +00:00
|
|
|
|
2017-01-02 21:04:09 +00:00
|
|
|
cd "$(dirname "$0")/.."
|
2020-06-25 18:34:47 +00:00
|
|
|
|
2021-02-08 15:16:40 +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
|
|
|
|
|
2021-02-08 15:16:40 +00:00
|
|
|
if [ ! -n "$DEVCONTAINER" ];then
|
|
|
|
python3 -m venv venv
|
|
|
|
source venv/bin/activate
|
|
|
|
fi
|
2020-06-25 18:34:47 +00:00
|
|
|
|
2015-09-17 07:35:26 +00:00
|
|
|
script/bootstrap
|
2017-05-24 22:31:51 +00:00
|
|
|
|
2019-07-30 23:59:12 +00:00
|
|
|
pre-commit install
|
2022-02-07 14:12:04 +00:00
|
|
|
python3 -m pip install -e . --constraint homeassistant/package_constraints.txt --use-deprecated=legacy-resolver
|
2020-06-25 18:34:47 +00:00
|
|
|
|
|
|
|
hass --script ensure_config -c config
|
|
|
|
|
2021-03-17 10:11:39 +00:00
|
|
|
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
|
2021-03-17 10:11:39 +00:00
|
|
|
fi
|