get_os() {
  os=""
  kernelName=""
  kernelName="$(uname -s)"
  if [ "${kernelName}" = "Darwin" ]; then
    os="macos"
  elif [ "${kernelName}" = "Linux" ] && \
    [ -e "/etc/os-release" ]; then
      os="$(. /etc/os-release; printf '%s' "${ID-}")"
  else
    os="${kernelName}"
  fi
  printf '%s' "${os}"
}

get_os_version() {
  os=""
  version=""
  os="$(get_os)"
  if [ "${os}" = "macos" ]; then
    version="$(sw_vers -productVersion)"
  elif [ -e "/etc/os-release" ]; then
    version="$(. /etc/os-release; printf '%s' "${VERSION_ID-}")"
  fi
  printf '%s' "${version}"
}

