wip/version
This commit is contained in:
parent
1e0ddbe940
commit
0b9cae5ceb
1 changed files with 8 additions and 3 deletions
11
cd.sh
11
cd.sh
|
@ -47,7 +47,13 @@ cd_set_environment_variables () {
|
||||||
case "$(cd_grep_os ID)" in
|
case "$(cd_grep_os ID)" in
|
||||||
"almalinux")
|
"almalinux")
|
||||||
CD_OS_ID="${CD_OS_ALMA}"
|
CD_OS_ID="${CD_OS_ALMA}"
|
||||||
CD_OS_VERSION="$(cd_grep_os VERSION_ID)"
|
CD_OS_VERSION=$(cd_grep_os VERSION_ID \
|
||||||
|
| sed "s|^\([0-9]\+\)\..*|\1|" )
|
||||||
|
;;
|
||||||
|
"alpine")
|
||||||
|
CD_OS_ID="${CD_OS_ALPINE}"
|
||||||
|
CD_OS_VERSION=$(cd_grep_os VERSION_ID \
|
||||||
|
| sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|" )
|
||||||
;;
|
;;
|
||||||
"debian")
|
"debian")
|
||||||
CD_OS_ID="${CD_OS_DEBIAN}"
|
CD_OS_ID="${CD_OS_DEBIAN}"
|
||||||
|
@ -402,8 +408,7 @@ local variable="${1}"
|
||||||
if [ "${variable}" ] ; then
|
if [ "${variable}" ] ; then
|
||||||
grep "^${variable}=" "/etc/os-release" \
|
grep "^${variable}=" "/etc/os-release" \
|
||||||
| sed "s|^${variable}=||" \
|
| sed "s|^${variable}=||" \
|
||||||
| sed "s|^\"\(.*\)\"$|\1|" \
|
| sed "s|^\"\(.*\)\"$|\1|"
|
||||||
| sed "s|^\([0-9]\+\)\..*|\1|"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue