mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Improve core script and default to upgrade (#17915)
This commit is contained in:
parent
071d078e84
commit
391aca6388
40
script/core
40
script/core
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# Helper to start Home Assistant Core inside the devcontainer
|
# Helper to start Home Assistant Core inside the devcontainer
|
||||||
|
|
||||||
# Stop on errors
|
# Stop on errors
|
||||||
@ -11,11 +11,35 @@ if [ -z "${DEVCONTAINER}" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $(which hass) ]; then
|
# Default to installing (or upgrading to) dev branch
|
||||||
echo "Installing Home Asstant core from dev."
|
coreURL="https://github.com/home-assistant/core.git"
|
||||||
python3 -m pip install --upgrade \
|
ref="dev"
|
||||||
colorlog \
|
|
||||||
git+https://github.com/home-assistant/home-assistant.git@dev
|
while getopts "hr:s" opt; do
|
||||||
|
case $opt in
|
||||||
|
h) # Help
|
||||||
|
echo "Usage: $0 [-h|-r <ref>|-s]"
|
||||||
|
echo -n "Install and run core at the given ref, i.e. branch, tag, or commit. The dev branch is used if no option is specified."
|
||||||
|
echo "The -s flag skips the install/upgrade, using whatever version is currently installed."
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
r) # Git ref
|
||||||
|
ref="${OPTARG}"
|
||||||
|
;;
|
||||||
|
s) # Skip (use current install)
|
||||||
|
ref=""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Try $0 -h for help" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$ref" ]; then
|
||||||
|
echo "Installing Home Assistant core at ${ref}..."
|
||||||
|
python3 -m pip install --user --upgrade --src "$HOME/src" \
|
||||||
|
--editable "git+${coreURL}@${ref}#egg=homeassistant"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "${WD}/config" ]; then
|
if [ ! -d "${WD}/config" ]; then
|
||||||
@ -30,7 +54,7 @@ logger:
|
|||||||
homeassistant.components.frontend: debug
|
homeassistant.components.frontend: debug
|
||||||
" >> "${WD}/config/configuration.yaml"
|
" >> "${WD}/config/configuration.yaml"
|
||||||
|
|
||||||
if [ ! -z "${HASSIO}" ]; then
|
if [ -n "${HASSIO}" ]; then
|
||||||
echo "
|
echo "
|
||||||
# frontend:
|
# frontend:
|
||||||
# development_repo: ${WD}
|
# development_repo: ${WD}
|
||||||
@ -46,7 +70,7 @@ frontend:
|
|||||||
# development_repo: ${WD}" >> "${WD}/config/configuration.yaml"
|
# development_repo: ${WD}" >> "${WD}/config/configuration.yaml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "${CODESPACES}" ]; then
|
if [ -n "${CODESPACES}" ]; then
|
||||||
echo "
|
echo "
|
||||||
http:
|
http:
|
||||||
use_x_forwarded_for: true
|
use_x_forwarded_for: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user