mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-04 14:54:07 +02:00
Get current from addon
This commit is contained in:
@@ -18,10 +18,21 @@ for addons in $(bashio::config "addon|keys"); do
|
|||||||
SLUG=$(bashio::config "addon[${addons}].slug")
|
SLUG=$(bashio::config "addon[${addons}].slug")
|
||||||
REPOSITORY=$(bashio::config "addon[${addons}].repository")
|
REPOSITORY=$(bashio::config "addon[${addons}].repository")
|
||||||
UPSTREAM=$(bashio::config "addon[${addons}].upstream")
|
UPSTREAM=$(bashio::config "addon[${addons}].upstream")
|
||||||
CURRENT=$(bashio::config "addon[${addons}].current")
|
|
||||||
BETA=$(bashio::config "addon[${addons}].beta")
|
BETA=$(bashio::config "addon[${addons}].beta")
|
||||||
BASENAME=$(basename "https://github.com/$REPOSITORY")
|
BASENAME=$(basename "https://github.com/$REPOSITORY")
|
||||||
bashio::log.info "... $SLUG : check started"
|
|
||||||
|
#Update local version
|
||||||
|
bashio::log.info "... $SLUG : cloning ${REPOSITORY}"
|
||||||
|
cd /
|
||||||
|
git clone "https://github.com/${REPOSITORY}" || cd "/${BASENAME}" && git fetch --all && git reset --hard origin/master
|
||||||
|
|
||||||
|
#Define the folder addon
|
||||||
|
bashio::log.info "... $SLUG : checking slug exists in repo"
|
||||||
|
cd /${BASENAME}/${SLUG} || bashio::log.error "$SLUG addon not found in this repository. Exiting." exit
|
||||||
|
|
||||||
|
#Find current version
|
||||||
|
bashio::log.info "... $SLUG : get current version"
|
||||||
|
CURRENT=$(jq .version config.json) || bashio::log.error "$SLUG addon version in config.json not found. Exiting." exit
|
||||||
|
|
||||||
#If beta flag, select beta version
|
#If beta flag, select beta version
|
||||||
if [ ${BETA} = true ]; then
|
if [ ${BETA} = true ]; then
|
||||||
@@ -35,15 +46,7 @@ for addons in $(bashio::config "addon|keys"); do
|
|||||||
if [ ${CURRENT} != ${LASTVERSION} ]; then
|
if [ ${CURRENT} != ${LASTVERSION} ]; then
|
||||||
bashio::log.info "... $SLUG : update from $CURRENT to $LASTVERSION"
|
bashio::log.info "... $SLUG : update from $CURRENT to $LASTVERSION"
|
||||||
|
|
||||||
#Update local version
|
|
||||||
bashio::log.info "... $SLUG : cloning base repo"
|
|
||||||
cd /
|
|
||||||
git clone "https://github.com/${REPOSITORY}" || cd "/${BASENAME}" && git fetch --all && git reset --hard origin/master
|
|
||||||
|
|
||||||
#Define the folder addon
|
|
||||||
bashio::log.info "... $SLUG : checking exists in repo"
|
|
||||||
cd /${BASENAME}/${SLUG} || bashio::log.error "$SLUG addon not found in this repository. Exiting." exit
|
|
||||||
|
|
||||||
#Change all instances of version
|
#Change all instances of version
|
||||||
bashio::log.info "... $SLUG : updating files"
|
bashio::log.info "... $SLUG : updating files"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user