mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-15 19:44:29 +05:00
refactor(mainsail/fluidd): allow reading of version from release_info.json
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -317,10 +317,16 @@ function get_fluidd_status() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_local_fluidd_version() {
|
function get_local_fluidd_version() {
|
||||||
[[ ! -f "${FLUIDD_DIR}/.version" ]] && return
|
local versionfile="${FLUIDD_DIR}/.version"
|
||||||
|
local relinfofile="${FLUIDD_DIR}/release_info.json"
|
||||||
local version
|
local version
|
||||||
version=$(head -n 1 "${FLUIDD_DIR}/.version")
|
|
||||||
|
if [[ -f ${relinfofile} ]]; then
|
||||||
|
version=$(grep -o '"version":"[^"]*' "${relinfofile}" | grep -o '[^"]*$')
|
||||||
|
elif [[ -f ${versionfile} ]]; then
|
||||||
|
version=$(head -n 1 "${versionfile}")
|
||||||
|
fi
|
||||||
|
|
||||||
echo "${version}"
|
echo "${version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -324,10 +324,16 @@ function get_mainsail_status() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_local_mainsail_version() {
|
function get_local_mainsail_version() {
|
||||||
[[ ! -f "${MAINSAIL_DIR}/.version" ]] && return
|
local versionfile="${MAINSAIL_DIR}/.version"
|
||||||
|
local relinfofile="${MAINSAIL_DIR}/release_info.json"
|
||||||
local version
|
local version
|
||||||
version=$(head -n 1 "${MAINSAIL_DIR}/.version")
|
|
||||||
|
if [[ -f ${relinfofile} ]]; then
|
||||||
|
version=$(grep -o '"version":"[^"]*' "${relinfofile}" | grep -o '[^"]*$')
|
||||||
|
elif [[ -f ${versionfile} ]]; then
|
||||||
|
version=$(head -n 1 "${versionfile}")
|
||||||
|
fi
|
||||||
|
|
||||||
echo "${version}"
|
echo "${version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user