mirror of
https://github.com/hassio-addons/bashio.git
synced 2025-05-06 20:11:24 +00:00
Replace update available logic with property access (#43)
This commit is contained in:
parent
1662ddf17f
commit
4fc9a14155
2 changed files with 6 additions and 28 deletions
15
lib/cli.sh
15
lib/cli.sh
|
@ -85,19 +85,8 @@ function bashio::cli.version_latest() {
|
||||||
# Checks if there is an update available for the CLI.
|
# Checks if there is an update available for the CLI.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::cli.update_available() {
|
function bashio::cli.update_available() {
|
||||||
local version
|
bashio::log.trace "${FUNCNAME[0]}" "$@"
|
||||||
local version_latest
|
bashio::cli 'cli.info.update_available' '.update_available // false'
|
||||||
|
|
||||||
bashio::log.trace "${FUNCNAME[0]}"
|
|
||||||
|
|
||||||
version=$(bashio::cli.version)
|
|
||||||
version_latest=$(bashio::cli.version_latest)
|
|
||||||
|
|
||||||
if [[ "${version}" = "${version_latest}" ]]; then
|
|
||||||
return "${__BASHIO_EXIT_NOK}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
return "${__BASHIO_EXIT_OK}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
19
lib/core.sh
19
lib/core.sh
|
@ -122,22 +122,11 @@ function bashio::core.version_latest() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Checks if there is an update available for the Supervisor.
|
# Checks if there is an update available for Home Assistant.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::supervisor.update_available() {
|
function bashio::core.update_available() {
|
||||||
local version
|
bashio::log.trace "${FUNCNAME[0]}" "$@"
|
||||||
local version_latest
|
bashio::cli 'core.info.update_available' '.update_available // false'
|
||||||
|
|
||||||
bashio::log.trace "${FUNCNAME[0]}"
|
|
||||||
|
|
||||||
version=$(bashio::core.version)
|
|
||||||
version_latest=$(bashio::core.version_latest)
|
|
||||||
|
|
||||||
if [[ "${version}" = "${version_latest}" ]]; then
|
|
||||||
return "${__BASHIO_EXIT_NOK}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
return "${__BASHIO_EXIT_OK}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue