mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 23:28:58 +00:00
Devcontainer (#7697)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
55
script/core
Executable file
55
script/core
Executable file
@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
# Helper to start Home Assistant Core inside the devcontainer
|
||||
|
||||
# Stop on errors
|
||||
set -e
|
||||
|
||||
if [ -z "${DEVCONTAINER}" ]; then
|
||||
echo "This task should only run inside a devcontainer, for local install HA Core in a venv."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -z "${CODESPACES}" ]; then
|
||||
WORKSPACE="/root/workspace/frontend"
|
||||
else
|
||||
WORKSPACE="/workspaces/frontend"
|
||||
fi
|
||||
|
||||
if [ -z $(which hass) ]; then
|
||||
echo "Installing Home Asstant core from dev."
|
||||
python3 -m pip install --upgrade \
|
||||
colorlog \
|
||||
git+git://github.com/home-assistant/home-assistant.git@dev
|
||||
fi
|
||||
|
||||
if [ ! -d "${WORKSPACE}/config" ]; then
|
||||
echo "Creating default configuration."
|
||||
mkdir -p "${WORKSPACE}/config";
|
||||
hass --script ensure_config -c config
|
||||
echo "demo:
|
||||
|
||||
logger:
|
||||
default: info
|
||||
logs:
|
||||
homeassistant.components.frontend: debug
|
||||
" >> "${WORKSPACE}/config/configuration.yaml"
|
||||
|
||||
if [ ! -z "${HASSIO}" ]; then
|
||||
echo "
|
||||
# frontend:
|
||||
# development_repo: ${WORKSPACE}
|
||||
|
||||
hassio:
|
||||
development_repo: ${WORKSPACE}" >> "${WORKSPACE}/config/configuration.yaml"
|
||||
else
|
||||
echo "
|
||||
frontend:
|
||||
development_repo: ${WORKSPACE}
|
||||
|
||||
# hassio:
|
||||
# development_repo: ${WORKSPACE}" >> "${WORKSPACE}/config/configuration.yaml"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
hass -c "${WORKSPACE}/config"
|
Reference in New Issue
Block a user