From 1d2f5ca2a53ebac679ae358b702c1b9a1bb88046 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Fri, 6 Dec 2019 00:01:19 +1300 Subject: [PATCH] Allow dev version to use branch from another github username (#5) --- esphome-dev/rootfs/etc/cont-init.d/30-esphome.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/esphome-dev/rootfs/etc/cont-init.d/30-esphome.sh b/esphome-dev/rootfs/etc/cont-init.d/30-esphome.sh index 086c5af..d9a80cd 100644 --- a/esphome-dev/rootfs/etc/cont-init.d/30-esphome.sh +++ b/esphome-dev/rootfs/etc/cont-init.d/30-esphome.sh @@ -8,7 +8,15 @@ declare esphome_version if bashio::config.has_value 'esphome_version'; then esphome_version=$(bashio::config 'esphome_version') - full_url="https://github.com/esphome/esphome/archive/${esphome_version}.zip" + if [[ $esphome_version == *":"* ]]; then + IFS=':' read -r -a array <<< "$esphome_version" + username=${array[0]} + ref=${array[1]} + else + username="esphome" + ref=$esphome_version + fi + full_url="https://github.com/${username}/esphome/archive/${ref}.zip" bashio::log.info "Installing esphome version '${esphome_version}' (${full_url})..." pip3 install -U --no-cache-dir "${full_url}" \ || bashio::exit.nok "Failed installing esphome pinned version."