Skip to content

Commit

Permalink
prelude.sh - add distro_version_lt
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-revay authored Oct 22, 2023
1 parent 9787d06 commit 21bb3c1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion prelude.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ if [[ "${__INITPC_PRELUDE_SOURCED__}" != "true" ]]; then
fi
}

# TODO make distro_version_le
# @param $1 - minimal distro major version
function distro_version_ge
{
Expand All @@ -92,6 +91,7 @@ if [[ "${__INITPC_PRELUDE_SOURCED__}" != "true" ]]; then
VERSION_ID="$(source /etc/os-release && echo "${VERSION_ID}")"
echo "Version ID=${VERSION_ID}"

# An empty VERSION_ID is interpretted as the (positive) infinity.
if [[ ${VERSION_ID} == "" ]]; then
echo "Warning: The version ID is empty."
return
Expand All @@ -106,6 +106,16 @@ if [[ "${__INITPC_PRELUDE_SOURCED__}" != "true" ]]; then
fi
}

function distro_version_lt {
$(distro_version_ge "$1")
if [[ $? == ${EXIT_INCORRECT_PLATFORM} ]]; then
return
else
# If VERSION_ID is empty we fail.
exit ${EXIT_INCORRECT_PLATFORM}
fi
}

function gnome_present
{
local GNOME_PRESENT="no"
Expand Down

0 comments on commit 21bb3c1

Please sign in to comment.